Package org.conscrypt

Class OpenSSLECDHKeyAgreement


  • @Internal
    public final class OpenSSLECDHKeyAgreement
    extends javax.crypto.KeyAgreementSpi
    Elliptic Curve Diffie-Hellman key agreement backed by the OpenSSL engine.
    • Field Detail

      • mOpenSslPrivateKey

        private OpenSSLKey mOpenSslPrivateKey
        OpenSSL handle of the private key. Only available after the engine has been initialized.
      • mExpectedResultLength

        private int mExpectedResultLength
        Expected length (in bytes) of the agreed key (mResult). Only available after the engine has been initialized.
    • Constructor Detail

      • OpenSSLECDHKeyAgreement

        public OpenSSLECDHKeyAgreement()
    • Method Detail

      • engineDoPhase

        public java.security.Key engineDoPhase​(java.security.Key key,
                                               boolean lastPhase)
                                        throws java.security.InvalidKeyException
        Specified by:
        engineDoPhase in class javax.crypto.KeyAgreementSpi
        Throws:
        java.security.InvalidKeyException
      • engineGenerateSecret

        protected int engineGenerateSecret​(byte[] sharedSecret,
                                           int offset)
                                    throws javax.crypto.ShortBufferException
        Specified by:
        engineGenerateSecret in class javax.crypto.KeyAgreementSpi
        Throws:
        javax.crypto.ShortBufferException
      • engineGenerateSecret

        protected byte[] engineGenerateSecret()
        Specified by:
        engineGenerateSecret in class javax.crypto.KeyAgreementSpi
      • engineGenerateSecret

        protected javax.crypto.SecretKey engineGenerateSecret​(java.lang.String algorithm)
        Specified by:
        engineGenerateSecret in class javax.crypto.KeyAgreementSpi
      • engineInit

        protected void engineInit​(java.security.Key key,
                                  java.security.SecureRandom random)
                           throws java.security.InvalidKeyException
        Specified by:
        engineInit in class javax.crypto.KeyAgreementSpi
        Throws:
        java.security.InvalidKeyException
      • engineInit

        protected void engineInit​(java.security.Key key,
                                  java.security.spec.AlgorithmParameterSpec params,
                                  java.security.SecureRandom random)
                           throws java.security.InvalidKeyException,
                                  java.security.InvalidAlgorithmParameterException
        Specified by:
        engineInit in class javax.crypto.KeyAgreementSpi
        Throws:
        java.security.InvalidKeyException
        java.security.InvalidAlgorithmParameterException
      • checkCompleted

        private void checkCompleted()