Class KeyPairFactory


  • public class KeyPairFactory
    extends Object
    • Constructor Detail

      • KeyPairFactory

        public KeyPairFactory​(String provider)
    • Method Detail

      • generate

        public KeyPair generate()
      • decodePublicKey

        public static PublicKey decodePublicKey​(byte[] encoded)
        Decodes an X.509 encoded public key.
        Parameters:
        encoded - the encoded public key.
        Returns:
        the PublicKey.
      • decodePrivateKey

        public static PrivateKey decodePrivateKey​(byte[] encoded)
        Decodes a PKCS#8 encoded private key. This is the default encoding for the private key getEncoded method.
        Parameters:
        encoded - the encoded data.
        Returns:
        the PrivateKey.