Package org.conscrypt
Class OpenSSLECDHKeyAgreement
java.lang.Object
javax.crypto.KeyAgreementSpi
org.conscrypt.OpenSSLECDHKeyAgreement
Elliptic Curve Diffie-Hellman key agreement backed by the OpenSSL engine.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate int
Expected length (in bytes) of the agreed key (mResult
).private OpenSSLKey
OpenSSL handle of the private key.private byte[]
Agreed key. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate void
engineDoPhase
(Key key, boolean lastPhase) protected byte[]
protected int
engineGenerateSecret
(byte[] sharedSecret, int offset) protected SecretKey
engineGenerateSecret
(String algorithm) protected void
engineInit
(Key key, SecureRandom random) protected void
engineInit
(Key key, AlgorithmParameterSpec params, SecureRandom random)
-
Field Details
-
mOpenSslPrivateKey
OpenSSL handle of the private key. Only available after the engine has been initialized. -
mExpectedResultLength
private int mExpectedResultLengthExpected length (in bytes) of the agreed key (mResult
). Only available after the engine has been initialized. -
mResult
private byte[] mResultAgreed key. Only available afterengineDoPhase(Key, boolean)
completes.
-
-
Constructor Details
-
OpenSSLECDHKeyAgreement
public OpenSSLECDHKeyAgreement()
-
-
Method Details
-
engineDoPhase
- Specified by:
engineDoPhase
in classKeyAgreementSpi
- Throws:
InvalidKeyException
-
engineGenerateSecret
- Specified by:
engineGenerateSecret
in classKeyAgreementSpi
- Throws:
ShortBufferException
-
engineGenerateSecret
protected byte[] engineGenerateSecret()- Specified by:
engineGenerateSecret
in classKeyAgreementSpi
-
engineGenerateSecret
- Specified by:
engineGenerateSecret
in classKeyAgreementSpi
-
engineInit
- Specified by:
engineInit
in classKeyAgreementSpi
- Throws:
InvalidKeyException
-
engineInit
protected void engineInit(Key key, AlgorithmParameterSpec params, SecureRandom random) throws InvalidKeyException, InvalidAlgorithmParameterException - Specified by:
engineInit
in classKeyAgreementSpi
- Throws:
InvalidKeyException
InvalidAlgorithmParameterException
-
checkCompleted
private void checkCompleted()
-