Oracle Security Developer Tools Crypto Java API Reference
10g Release 2 (10.1.2.0.2)

B15565-01


oracle.security.crypto.core
Class KeyAgreement

java.lang.Object
  extended byoracle.security.crypto.core.KeyAgreement

Direct Known Subclasses:
DHKeyAgreement

public abstract class KeyAgreement
extends java.lang.Object

*** For internal use only *** An abstract class for public key agreement scheme.

Status: Provisional (may be changed in future releases.)


Constructor Summary
protected KeyAgreement()

Method Summary
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 public key and the other party private key.
abstract AlgorithmIdentifier getAlgID()
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)
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.

Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

KeyAgreement

protected KeyAgreement()

Method Detail

getInstance

public static KeyAgreement getInstance(AlgorithmIdentifier algID)
                                throws AlgorithmIdentifierException
Create a new instance of the KeyAgreement subclass for the specified algorithm identifier.
Parameters:
algID - One of the key agreement algorithm identifiers defined in AlgID.
Throws:
AlgorithmIdentifierException

getInstance

public static KeyAgreement getInstance(PrivateKey privKey)
                                throws KeyAgreementException
Create a new instance of the KeyAgreement subclass for the specified key's algorithm and the local party PrivateKey.
Parameters:
privKey - The private key for the local party.
Throws:
KeyAgreementException

getInstance

public static KeyAgreement getInstance(PublicKey pubKey)
                                throws KeyAgreementException
Create a new instance of the KeyAgreement subclass for the specified key's algorithm and the other party public key.
Parameters:
pubKey - The public key for the other party.
Throws:
KeyAgreementException

setAlgID

public abstract void setAlgID(AlgorithmIdentifier algID)
                       throws AlgorithmIdentifierException
Throws:
AlgorithmIdentifierException

getAlgID

public abstract AlgorithmIdentifier getAlgID()

setPrivateKey

public abstract void setPrivateKey(PrivateKey key)
                            throws InvalidKeyException
Sets the private key of the local party for generating secret value.
Throws:
InvalidKeyException

generateSecret

public abstract byte[] generateSecret()
                               throws KeyAgreementException
Generate the shared secret value from the local party public key and the other party private key.
Throws:
KeyAgreementException

setPublicKey

public abstract void setPublicKey(PublicKey key)
                           throws InvalidKeyException
Sets the public key of the other party for generating secret value.
Throws:
InvalidKeyException

getPublicKey

public abstract PublicKey getPublicKey()
Gets the public key of the other party.

algName

public abstract java.lang.String algName()
Returns the name of the key agreement algorithm.
Returns:
a string which identifies the key agreement algorithm

Oracle Security Developer Tools Crypto Java API Reference
10g Release 2 (10.1.2.0.2)

B15565-01


Copyright © 2005 , Oracle. All rights reserved.