Package org.conscrypt

Class OpenSSLXDHKeyFactory


  • @Internal
    public final class OpenSSLXDHKeyFactory
    extends java.security.KeyFactorySpi
    An implementation of a KeyFactorySpi for XEC keys based on BoringSSL.
    • Field Detail

      • javaXecPublicKeySpec

        private static final java.lang.Class<?> javaXecPublicKeySpec
      • javaXecPrivateKeySpec

        private static final java.lang.Class<?> javaXecPrivateKeySpec
      • javaX25519AlgorithmSpec

        private static final java.security.spec.AlgorithmParameterSpec javaX25519AlgorithmSpec
    • Constructor Detail

      • OpenSSLXDHKeyFactory

        public OpenSSLXDHKeyFactory()
    • Method Detail

      • engineGeneratePublic

        protected java.security.PublicKey engineGeneratePublic​(java.security.spec.KeySpec keySpec)
                                                        throws java.security.spec.InvalidKeySpecException
        Specified by:
        engineGeneratePublic in class java.security.KeyFactorySpi
        Throws:
        java.security.spec.InvalidKeySpecException
      • engineGeneratePrivate

        protected java.security.PrivateKey engineGeneratePrivate​(java.security.spec.KeySpec keySpec)
                                                          throws java.security.spec.InvalidKeySpecException
        Specified by:
        engineGeneratePrivate in class java.security.KeyFactorySpi
        Throws:
        java.security.spec.InvalidKeySpecException
      • engineGetKeySpec

        protected <T extends java.security.spec.KeySpec> T engineGetKeySpec​(java.security.Key key,
                                                                            java.lang.Class<T> keySpec)
                                                                     throws java.security.spec.InvalidKeySpecException
        Specified by:
        engineGetKeySpec in class java.security.KeyFactorySpi
        Throws:
        java.security.spec.InvalidKeySpecException
      • engineTranslateKey

        protected java.security.Key engineTranslateKey​(java.security.Key key)
                                                throws java.security.InvalidKeyException
        Specified by:
        engineTranslateKey in class java.security.KeyFactorySpi
        Throws:
        java.security.InvalidKeyException
      • getJavaXECPrivateKeySpec

        private static java.lang.Class<?> getJavaXECPrivateKeySpec()
      • getJavaXECPublicKeySpec

        private static java.lang.Class<?> getJavaXECPublicKeySpec()
      • getJavaX25519ParameterSpec

        private static java.security.spec.AlgorithmParameterSpec getJavaX25519ParameterSpec()
      • constructJavaPrivateKeySpec

        private java.security.spec.KeySpec constructJavaPrivateKeySpec​(OpenSSLX25519PrivateKey privateKey)
                                                                throws java.security.spec.InvalidKeySpecException
        Throws:
        java.security.spec.InvalidKeySpecException
      • uToBigInteger

        private java.math.BigInteger uToBigInteger​(byte[] u)
      • constructJavaXecPublicKeySpec

        private java.security.spec.KeySpec constructJavaXecPublicKeySpec​(OpenSSLX25519PublicKey publicKey)
                                                                  throws java.security.spec.InvalidKeySpecException
        Throws:
        java.security.spec.InvalidKeySpecException