Package 

Class RSAConverter

  • All Implemented Interfaces:

    
    public class RSAConverter
    
                        

    Several conversion functions for RSA and PEM keys

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
    • Field Summary

      Fields 
      Modifier and Type Field Description
    • Constructor Summary

      Constructors 
      Constructor Description
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Constructor Detail

    • Method Detail

      • publicToPEM

         static String publicToPEM(PublicKey publicKey)

        Convert a public RSA key to a PEM key.

        Parameters:
        publicKey - The public key to convert.
      • privateToPEM

         static String privateToPEM(PrivateKey privateKey)

        Convert a private RSA key to a PEM key.

        Parameters:
        privateKey - The private key to convert.
      • pemToBytes

         static Array<byte> pemToBytes(String pem)

        Convert a PEM key to a byte array. They key isn't checked before conversion!

        Parameters:
        pem - The PEM key to convert to a byte array.
      • bytesToPublicKey

         static PublicKey bytesToPublicKey(Array<byte> bytes)

        Convert bytes to an RSA public key.

        Parameters:
        bytes - The bytes to convert.
      • privateKeyToKeyPair

         static KeyPair privateKeyToKeyPair(PrivateKey privateKey)

        Convert a private RSA key to a KeyPair with the public key.

        Parameters:
        privateKey - The private RSA key.
      • getBytes

         static Array<byte> getBytes(PrivateKey key)

        Convert a private RSA key to

        Parameters:
        key - The private RSA key to convert.
      • getBytes

         static Array<byte> getBytes(PublicKey key)

        Convert a public RSA key to

        Parameters:
        key - The public RSA key to convert.