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 Key
engineDoPhase(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 int
engineGenerateSecret(byte[] sharedSecret, int offset)
protected SecretKey
engineGenerateSecret(String algorithm)
Returns a secret key object for a provided algorithm from shared secret keyIdprotected void
engineInit(Key key, SecureRandom random)
protected void
engineInit(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:
engineDoPhase
in classKeyAgreementSpi
- Throws:
InvalidKeyException
IllegalStateException
-
engineGenerateSecret
protected byte[] engineGenerateSecret() throws IllegalStateException
Returns shared secret from shared secret key- Specified by:
engineGenerateSecret
in 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:
engineGenerateSecret
in classKeyAgreementSpi
- Throws:
IllegalStateException
NoSuchAlgorithmException
InvalidKeyException
-
engineGenerateSecret
protected int engineGenerateSecret(byte[] sharedSecret, int offset) throws IllegalStateException, ShortBufferException
- Specified by:
engineGenerateSecret
in classKeyAgreementSpi
- Throws:
IllegalStateException
ShortBufferException
-
engineInit
protected void engineInit(Key key, SecureRandom random) throws InvalidKeyException
- 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
-
-