Skip navigation links

Oracle Fusion Middleware Crypto FIPS Java API Reference for Oracle Security Developer Tools
11g Release 1 (11.1.1)

E10696-05


oracle.security.crypto.core
Class DHKeyAgreement

java.lang.Object
  extended by oracle.security.crypto.core.KeyAgreement
      extended by oracle.security.crypto.core.DHKeyAgreement


public class DHKeyAgreement
extends KeyAgreement

Implements the Diffie-Hellman algorithm for static shared secret generation, as specified in ANSI X9.42.

To generate a secret key value, the local party private key and the other party public key must be present. If parameters are missing from any of the keys, they should be known from the application envrionment and must be set before using this class.

See Also:
DHKey, DHPublicKey, DHPrivateKey

Constructor Summary
DHKeyAgreement()
          Create a new uninitialized instance of DHKeyAgreement.
DHKeyAgreement(DHPrivateKey privKey)
          Create a new instance of DHKeyAgreement with the specified local party private key.
DHKeyAgreement(DHPrivateKey privKey, DHPublicKey pubKey)
          Create a new instance of DHKeyAgreement with the specified local party private key and the other party public key.
DHKeyAgreement(DHPublicKey pubKey)
          Create a new instance of DHKeyAgreement with the specified other party public key.

 

Method Summary
 java.lang.String algName()
          Returns the name of the key agreement algorithm.
 byte[] generateSecret()
          Generate the shared secret value from the local party private key and the other party public key.
 AlgorithmIdentifier getAlgID()
          Gets the algorithm identifier of this key agreeement.
 PublicKey getPublicKey()
          Returns the public (other party's) key.
 void setAlgID(AlgorithmIdentifier algID)
          Sets the algorith identifier of the key agreement object.
 void setPrivateKey(PrivateKey privKey)
          Sets the local party private key for generating secret value.
 void setPublicKey(PublicKey pubKey)
          Sets the other party public key for generating secret value.

 

Methods inherited from class oracle.security.crypto.core.KeyAgreement
getInstance, getInstance, getInstance

 

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

 

Constructor Detail

DHKeyAgreement

public DHKeyAgreement()
Create a new uninitialized instance of DHKeyAgreement.

DHKeyAgreement

public DHKeyAgreement(DHPrivateKey privKey)
               throws InvalidKeyException
Create a new instance of DHKeyAgreement with the specified local party private key.
Parameters:
privKey - The private key for the local party.
Throws:
InvalidKeyException

DHKeyAgreement

public DHKeyAgreement(DHPublicKey pubKey)
               throws InvalidKeyException
Create a new instance of DHKeyAgreement with the specified other party public key.
Parameters:
pubKey - The public key for the other party.
Throws:
InvalidKeyException

DHKeyAgreement

public DHKeyAgreement(DHPrivateKey privKey,
                      DHPublicKey pubKey)
               throws InvalidKeyException
Create a new instance of DHKeyAgreement with the specified local party private key and the other party public key.
Parameters:
privKey - The private key for the local party.
pubKey - The public key for the other party.
Throws:
InvalidKeyException

Method Detail

setAlgID

public void setAlgID(AlgorithmIdentifier algID)
              throws AlgorithmIdentifierException
Description copied from class: KeyAgreement
Sets the algorith identifier of the key agreement object.
Specified by:
setAlgID in class KeyAgreement
Parameters:
algID - The AlgorithmIdentifier to use for this KeyAgreement.
Throws:
AlgorithmIdentifierException

getAlgID

public AlgorithmIdentifier getAlgID()
Description copied from class: KeyAgreement
Gets the algorithm identifier of this key agreeement.
Specified by:
getAlgID in class KeyAgreement
Returns:
An AlgorithmIdentifier representing the algorithm used in this key agreement.

setPrivateKey

public void setPrivateKey(PrivateKey privKey)
                   throws InvalidKeyException
Sets the local party private key for generating secret value.
Specified by:
setPrivateKey in class KeyAgreement
Parameters:
privKey - The private key for the local party.
Throws:
InvalidKeyException

setPublicKey

public void setPublicKey(PublicKey pubKey)
                  throws InvalidKeyException
Sets the other party public key for generating secret value.
Specified by:
setPublicKey in class KeyAgreement
Parameters:
pubKey - The public key of the other party.
Throws:
InvalidKeyException

getPublicKey

public PublicKey getPublicKey()
Returns the public (other party's) key.
Specified by:
getPublicKey in class KeyAgreement
Returns:
The other party's public key.

algName

public java.lang.String algName()
Returns the name of the key agreement algorithm.
Specified by:
algName in class KeyAgreement
Returns:
"Diffie-Hellman"

generateSecret

public byte[] generateSecret()
                      throws KeyAgreementException
Description copied from class: KeyAgreement
Generate the shared secret value from the local party private key and the other party public key.
Specified by:
generateSecret in class KeyAgreement
Throws:
KeyAgreementException

Skip navigation links

Oracle Fusion Middleware Crypto FIPS Java API Reference for Oracle Security Developer Tools
11g Release 1 (11.1.1)

E10696-05


Copyright © 2005, 2013, Oracle. All rights reserved.