Class ECDHKeyAgreement
- java.lang.Object
-
- javax.crypto.KeyAgreementSpi
-
- com.fortanix.sdkms.jce.provider.agreement.ECDHKeyAgreement
-
public class ECDHKeyAgreement extends KeyAgreementSpi
-
-
Constructor Summary
Constructors Constructor Description ECDHKeyAgreement()Constructs a new ECDHKeyAgreement.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected KeyengineDoPhase(Key key, boolean lastPhase)Performs key agreement for a provided public key and initialized private keyprotected byte[]engineGenerateSecret()Returns shared secret from shared secret keyprotected intengineGenerateSecret(byte[] sharedSecret, int offset)protected SecretKeyengineGenerateSecret(String algorithm)Returns a secret key object for a provided algorithm from shared secret keyIdprotected voidengineInit(Key key, SecureRandom random)protected voidengineInit(Key key, AlgorithmParameterSpec params, SecureRandom random)
-
-
-
Method Detail
-
engineDoPhase
protected Key engineDoPhase(Key key, boolean lastPhase) throws InvalidKeyException, IllegalStateException
Performs key agreement for a provided public key and initialized private key- Specified by:
engineDoPhasein classKeyAgreementSpi- Throws:
InvalidKeyExceptionIllegalStateException
-
engineGenerateSecret
protected byte[] engineGenerateSecret() throws IllegalStateExceptionReturns shared secret from shared secret key- Specified by:
engineGenerateSecretin classKeyAgreementSpi- Throws:
IllegalStateException
-
engineGenerateSecret
protected SecretKey engineGenerateSecret(String algorithm) throws IllegalStateException, NoSuchAlgorithmException, InvalidKeyException
Returns a secret key object for a provided algorithm from shared secret keyId- Specified by:
engineGenerateSecretin classKeyAgreementSpi- Throws:
IllegalStateExceptionNoSuchAlgorithmExceptionInvalidKeyException
-
engineGenerateSecret
protected int engineGenerateSecret(byte[] sharedSecret, int offset) throws IllegalStateException, ShortBufferException- Specified by:
engineGenerateSecretin classKeyAgreementSpi- Throws:
IllegalStateExceptionShortBufferException
-
engineInit
protected void engineInit(Key key, SecureRandom random) throws InvalidKeyException
- 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
-
-