public abstract class KeyAgreement
extends java.lang.Object
Status: Provisional (may be changed in future releases.)
| Modifier | Constructor and Description |
|---|---|
protected |
KeyAgreement()
Empty constructor.
|
| Modifier and Type | Method and Description |
|---|---|
abstract java.lang.String |
algName()
Returns the name of the key agreement algorithm.
|
abstract byte[] |
generateSecret()
Generate the shared secret value from the local party private key and the other party public key.
|
abstract AlgorithmIdentifier |
getAlgID()
Gets the algorithm identifier of this key agreeement.
|
static KeyAgreement |
getInstance(AlgorithmIdentifier algID)
Create a new instance of the
KeyAgreement subclass for the specified algorithm identifier. |
static KeyAgreement |
getInstance(PrivateKey privKey)
Create a new instance of the
KeyAgreement subclass for the specified key's algorithm and the local party PrivateKey. |
static KeyAgreement |
getInstance(PublicKey pubKey)
Create a new instance of the
KeyAgreement subclass for the specified key's algorithm and the other party public key. |
abstract PublicKey |
getPublicKey()
Gets the public key of the other party.
|
abstract void |
setAlgID(AlgorithmIdentifier algID)
Sets the algorith identifier of the key agreement object.
|
abstract void |
setPrivateKey(PrivateKey key)
Sets the private key of the local party for generating secret value.
|
abstract void |
setPublicKey(PublicKey key)
Sets the public key of the other party for generating secret value.
|
public static KeyAgreement getInstance(AlgorithmIdentifier algID) throws AlgorithmIdentifierException
KeyAgreement subclass for the specified algorithm identifier.algID - One of the key agreement algorithm identifiers defined in AlgID.AlgorithmIdentifierExceptionpublic static KeyAgreement getInstance(PrivateKey privKey) throws KeyAgreementException
KeyAgreement subclass for the specified key's algorithm and the local party PrivateKey.privKey - The private key for the local party.KeyAgreementExceptionpublic static KeyAgreement getInstance(PublicKey pubKey) throws KeyAgreementException
KeyAgreement subclass for the specified key's algorithm and the other party public key.pubKey - The public key for the other party.KeyAgreementExceptionpublic abstract void setAlgID(AlgorithmIdentifier algID) throws AlgorithmIdentifierException
algID - The AlgorithmIdentifier to use for this KeyAgreement.AlgorithmIdentifierExceptionpublic abstract AlgorithmIdentifier getAlgID()
AlgorithmIdentifier representing the algorithm used in this key agreement.public abstract void setPrivateKey(PrivateKey key) throws InvalidKeyException
InvalidKeyException
public abstract byte[] generateSecret()
throws KeyAgreementException
KeyAgreementExceptionpublic abstract void setPublicKey(PublicKey key) throws InvalidKeyException
InvalidKeyExceptionpublic abstract PublicKey getPublicKey()
public abstract java.lang.String algName()