Package org.conscrypt
Class OpenSSLXDHKeyAgreement
- java.lang.Object
-
- javax.crypto.KeyAgreementSpi
-
- org.conscrypt.OpenSSLBaseDHKeyAgreement<byte[]>
-
- org.conscrypt.OpenSSLXDHKeyAgreement
-
@Internal public final class OpenSSLXDHKeyAgreement extends OpenSSLBaseDHKeyAgreement<byte[]>
Elliptic Curve Diffie-Hellman key agreement backed by the OpenSSL engine.
-
-
Constructor Summary
Constructors Constructor Description OpenSSLXDHKeyAgreement()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected intcomputeKey(byte[] buffer, byte[] theirPublicKey, byte[] ourPrivateKey)Given the public keytheirPublicKeyand the private keyourPrivateKeywrite the shared secret tobufferand return the actual output size.protected byte[]convertPrivateKey(java.security.PrivateKey key)protected byte[]convertPublicKey(java.security.PublicKey key)protected intgetOutputSize(byte[] key)Returns the expected result length for the givenkey.-
Methods inherited from class org.conscrypt.OpenSSLBaseDHKeyAgreement
engineDoPhase, engineGenerateSecret, engineGenerateSecret, engineGenerateSecret, engineInit, engineInit
-
-
-
-
Method Detail
-
convertPublicKey
protected byte[] convertPublicKey(java.security.PublicKey key) throws java.security.InvalidKeyException- Specified by:
convertPublicKeyin classOpenSSLBaseDHKeyAgreement<byte[]>- Throws:
java.security.InvalidKeyException
-
convertPrivateKey
protected byte[] convertPrivateKey(java.security.PrivateKey key) throws java.security.InvalidKeyException- Specified by:
convertPrivateKeyin classOpenSSLBaseDHKeyAgreement<byte[]>- Throws:
java.security.InvalidKeyException
-
computeKey
protected int computeKey(byte[] buffer, byte[] theirPublicKey, byte[] ourPrivateKey) throws java.security.InvalidKeyExceptionDescription copied from class:OpenSSLBaseDHKeyAgreementGiven the public keytheirPublicKeyand the private keyourPrivateKeywrite the shared secret tobufferand return the actual output size.- Specified by:
computeKeyin classOpenSSLBaseDHKeyAgreement<byte[]>- Throws:
java.security.InvalidKeyException
-
getOutputSize
protected int getOutputSize(byte[] key)
Description copied from class:OpenSSLBaseDHKeyAgreementReturns the expected result length for the givenkey.- Specified by:
getOutputSizein classOpenSSLBaseDHKeyAgreement<byte[]>
-
-