public class KeyAgreementSpi extends KeyAgreementSpi
| Constructor and Description |
|---|
KeyAgreementSpi() |
| Modifier and Type | Method and Description |
|---|---|
protected Key |
engineDoPhase(Key key,
boolean lastPhase)
Does the next (or the last) phase of the key agreement, using the
specified key.
|
protected byte[] |
engineGenerateSecret()
Generates the shared secret.
|
protected int |
engineGenerateSecret(byte[] sharedSecret,
int offset)
Generates the shared secret and stores it into the buffer
sharedSecred at offset. |
protected SecretKey |
engineGenerateSecret(String algorithm)
Generates the shared secret.
|
protected void |
engineInit(Key key,
AlgorithmParameterSpec params,
SecureRandom random)
Initializes this
KeyAgreementSpi with the specified key,
algorithm parameters and randomness source. |
protected void |
engineInit(Key key,
SecureRandom random)
Initializes this
KeyAgreementSpi with the specified key and the
specified randomness source. |
protected Key engineDoPhase(Key key, boolean lastPhase) throws InvalidKeyException, IllegalStateException
KeyAgreementSpiengineDoPhase in class KeyAgreementSpikey - the key received from the other party for this phase.lastPhase - set to true if this is the last phase of this key
agreement.InvalidKeyException - if the specified key cannot be used in this key agreement or
this phase,IllegalStateException - if this instance has not been initialized.protected byte[] engineGenerateSecret()
throws IllegalStateException
KeyAgreementSpiengineGenerateSecret in class KeyAgreementSpiIllegalStateException - if this key agreement is not complete.protected int engineGenerateSecret(byte[] sharedSecret,
int offset)
throws IllegalStateException,
ShortBufferException
KeyAgreementSpisharedSecred at offset.engineGenerateSecret in class KeyAgreementSpisharedSecret - the buffer to store the shared secret.offset - the offset in the buffer.IllegalStateException - if this key agreement is not complete.ShortBufferException - if the specified buffer is too small for the shared secret.protected SecretKey engineGenerateSecret(String algorithm)
KeyAgreementSpiengineGenerateSecret in class KeyAgreementSpialgorithm - the algorithm to for the SecretKeySecretKey of the specified
algorithm.protected void engineInit(Key key, AlgorithmParameterSpec params, SecureRandom random) throws InvalidKeyException, InvalidAlgorithmParameterException
KeyAgreementSpiKeyAgreementSpi with the specified key,
algorithm parameters and randomness source.engineInit in class KeyAgreementSpikey - the key to initialize this key agreement.params - the parameters for this key agreement algorithm.random - the source for any randomness needed.InvalidKeyException - if the specified key cannot be used to initialize this key
agreement.InvalidAlgorithmParameterException - if the specified parameters are invalid for this key
agreement algorithm.protected void engineInit(Key key, SecureRandom random) throws InvalidKeyException
KeyAgreementSpiKeyAgreementSpi with the specified key and the
specified randomness source.engineInit in class KeyAgreementSpikey - the key to initialize this key agreement.random - the source for any randomness needed.InvalidKeyException - if the specified key cannot be used to initialize this key
agreement.