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 intExpected length (in bytes) of the agreed key (mResult).private OpenSSLKeyOpenSSL handle of the private key.private byte[]Agreed key. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate voidengineDoPhase(Key key, boolean lastPhase) protected byte[]protected intengineGenerateSecret(byte[] sharedSecret, int offset) protected SecretKeyengineGenerateSecret(String algorithm) protected voidengineInit(Key key, SecureRandom random) protected voidengineInit(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:
engineDoPhasein classKeyAgreementSpi- Throws:
InvalidKeyException
-
engineGenerateSecret
- Specified by:
engineGenerateSecretin classKeyAgreementSpi- Throws:
ShortBufferException
-
engineGenerateSecret
protected byte[] engineGenerateSecret()- Specified by:
engineGenerateSecretin classKeyAgreementSpi
-
engineGenerateSecret
- Specified by:
engineGenerateSecretin classKeyAgreementSpi
-
engineInit
- Specified by:
engineInitin classKeyAgreementSpi- Throws:
InvalidKeyException
-
engineInit
protected void engineInit(Key key, AlgorithmParameterSpec params, SecureRandom random) throws InvalidKeyException, InvalidAlgorithmParameterException - Specified by:
engineInitin classKeyAgreementSpi- Throws:
InvalidKeyExceptionInvalidAlgorithmParameterException
-
checkCompleted
private void checkCompleted()
-