public class SPEKEKeyAgreement extends DHKeyAgreement
This class SHOULD NOT be used directly; it should only be used through the JCA/JCE.
| Constructor and Description |
|---|
SPEKEKeyAgreement()
The constructor; creates a new instance of the SPEKE key agreement
algorithm.
|
| Modifier and Type | Method and Description |
|---|---|
protected java.security.Key |
engineDoPhase(java.security.Key key,
boolean lastPhase)
Executes the next phase of this key agreement with the given key that was
received from one of the other parties involved in this key agreement.
|
protected byte[] |
engineGenerateSecret()
Generates the shared secret and returns it in a new buffer.
|
protected void |
engineInit(java.security.Key key,
java.security.spec.AlgorithmParameterSpec params,
java.security.SecureRandom random)
Initializes this key agreement with the given key, set of algorithm
parameters, and source of randomness.
|
protected void |
engineInit(java.security.Key key,
java.security.SecureRandom random)
Initializes this key agreement with the given key and source of
randomness.
|
engineGenerateSecret, engineGenerateSecretpublic SPEKEKeyAgreement()
Applications should never use this constructor, instead the key agreement
algorithm should be requested from the appropriate JCA/JCE cryptographic
service provider as follows:
KeyAgreement.getInstance("SPEKE", "Entrust").
protected void engineInit(java.security.Key key,
java.security.SecureRandom random)
throws java.security.InvalidKeyException
DHKeyAgreement
If the key agreement algorithm requires random bytes, it gets them from
the given source of randomness, random. However, if the
underlying algorithm implementation does not require any random bytes,
random is ignored.
engineInit in class DHKeyAgreementkey - [FIPS 140-2 data input] [FIPS 140-2 CSP] the party's private
information. For example, in the case of the Diffie-Hellman
key agreement, this would be the party's own Diffie-Hellman
private key.random - [FIPS 140-2 control input] the source of randomnessjava.security.InvalidKeyException - [FIPS 140-2 status output] if the given key is
inappropriate for this key agreement, e.g., is of the
wrong type or has an incompatible algorithm type.protected void engineInit(java.security.Key key,
java.security.spec.AlgorithmParameterSpec params,
java.security.SecureRandom random)
throws java.security.InvalidKeyException
DHKeyAgreementengineInit in class DHKeyAgreementkey - [FIPS 140-2 data input] [FIPS 140-2 CSP] the party's private
information. For example, in the case of the Diffie-Hellman
key agreement, this would be the party's own Diffie-Hellman
private key.params - [FIPS 140-2 data input] the key agreement parametersrandom - [FIPS 140-2 control input] the source of randomnessjava.security.InvalidKeyException - [FIPS 140-2 status output] if the given key is
inappropriate for this key agreement, e.g., is of the
wrong type or has an incompatible algorithm type.protected java.security.Key engineDoPhase(java.security.Key key,
boolean lastPhase)
throws java.security.InvalidKeyException,
java.lang.SecurityException
DHKeyAgreementengineDoPhase in class DHKeyAgreementkey - [FIPS 140-2 data input] [FIPS 140-2 CSP] the key for this
phase. For example, in the case of Diffie-Hellman between 2
parties, this would be the other party's Diffie-Hellman public
key.lastPhase - [FIPS 140-2 control input] flag which indicates whether or not
this is the last phase of this key agreement.java.security.InvalidKeyException - [FIPS 140-2 status output] if the given key is
inappropriate for this phase.java.lang.SecurityExceptionprotected byte[] engineGenerateSecret()
DHKeyAgreement
This method resets this KeyAgreementSpi object, so that it
can be reused for further key agreements. Unless this key agreement is
reinitialized with one of the engineInit methods, the same
private information and algorithm parameters will be used for subsequent
key agreements.
engineGenerateSecret in class DHKeyAgreement