Class JCEECDHKeyAgreement
java.lang.Object
javax.crypto.KeyAgreementSpi
org.gudy.bouncycastle.jce.provider.JCEECDHKeyAgreement
- Direct Known Subclasses:
JCEECDHKeyAgreement.DH
Diffie-Hellman key agreement using elliptic curve keys, ala IEEE P1363
both the simple one, and the simple one with cofactors are supported.
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate BasicAgreement
private CipherParameters
private BigInteger
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected Key
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) byte[]
void
-
Field Details
-
result
-
privKey
-
agreement
-
-
Constructor Details
-
JCEECDHKeyAgreement
-
-
Method Details
-
doPhase
-
engineDoPhase
protected Key engineDoPhase(Key key, boolean lastPhase) throws InvalidKeyException, IllegalStateException - Specified by:
engineDoPhase
in classKeyAgreementSpi
- Throws:
InvalidKeyException
IllegalStateException
-
generateSecret
- Throws:
IllegalStateException
-
engineGenerateSecret
- Specified by:
engineGenerateSecret
in classKeyAgreementSpi
- Throws:
IllegalStateException
-
engineGenerateSecret
protected int engineGenerateSecret(byte[] sharedSecret, int offset) throws IllegalStateException, ShortBufferException - Specified by:
engineGenerateSecret
in classKeyAgreementSpi
- Throws:
IllegalStateException
ShortBufferException
-
engineGenerateSecret
- Specified by:
engineGenerateSecret
in classKeyAgreementSpi
-
init
-
engineInit
protected void engineInit(Key key, AlgorithmParameterSpec params, SecureRandom random) throws InvalidKeyException, InvalidAlgorithmParameterException - Specified by:
engineInit
in classKeyAgreementSpi
- Throws:
InvalidKeyException
InvalidAlgorithmParameterException
-
engineInit
- Specified by:
engineInit
in classKeyAgreementSpi
- Throws:
InvalidKeyException
-