Oracle Security Developer Tools Crypto Java API Reference
10g (10.1.4.0.1)

B28171-01


oracle.security.crypto.core
Class DHPublicKey

java.lang.Object
  extended byoracle.security.crypto.core.DHKey
      extended byoracle.security.crypto.core.DHPublicKey

All Implemented Interfaces:
ASN1Object, java.lang.Cloneable, java.io.Externalizable, Key, PublicKey, java.io.Serializable, Streamable

public class DHPublicKey
extends DHKey
implements PublicKey

*** For internal use only *** Diffie-Hellman public key as described in ANSI X9.42.

The Diffie-Hellman public key contains a DHParams and a public key value y is represented as the X509 type SubjectPublicKeyInfo.

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

See Also:
DHKey, DHPublicKey, DHParams, Serialized Form

Field Summary

 

Fields inherited from class oracle.security.crypto.core.DHKey
params

 

Constructor Summary
DHPublicKey()
          Constructs a new, uninitialized instance.
DHPublicKey(java.math.BigInteger y, DHParams params)
          Constructs a new instance with the given set of parameters and value of y.
DHPublicKey(java.io.InputStream is)
          Constructs a new instance by reading its encoding from the given input stream.

 

Method Summary
 java.lang.Object clone()
          Performs a deep clone of the Key instance.
 void erase()
          Erases the key material, making the key un-usable.
 AlgorithmIdentifier getAlgID()
           
 ASN1Object getContents()
           
 java.lang.String getFormat()
          Returns a string which indicates the format of this object's encoding.
 java.math.BigInteger getY()
          Gets the public key value y.
 void initialize(AlgorithmIdentifier algID, ASN1Object contents)
           
 void input(java.io.InputStream is)
          Inputs a DHPublicKey object by reading its encoding from the given input stream.
 int length()
          Gets the length of the encoding of this object.
 void output(java.io.OutputStream os)
          Outputs the ASN1 encoding of this object to a given output stream.
 void setParams(DHParams params)
          Sets the parameters for the Diffie-Hellman key.
 java.lang.String toString()
          Returns a string representation of this object.

 

Methods inherited from class oracle.security.crypto.core.DHKey
getAlgorithm, getBitLength, getEncoded, getParams, readExternal, writeExternal

 

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

 

Methods inherited from interface oracle.security.crypto.core.Key
getAlgorithm, getBitLength, getEncoded

 

Constructor Detail

DHPublicKey

public DHPublicKey()
Constructs a new, uninitialized instance.

DHPublicKey

public DHPublicKey(java.math.BigInteger y,
                   DHParams params)
Constructs a new instance with the given set of parameters and value of y.
Parameters:
y - the value of y
params - the DHParams of this DHPublicKey

DHPublicKey

public DHPublicKey(java.io.InputStream is)
            throws java.io.IOException
Constructs a new instance by reading its encoding from the given input stream.
Parameters:
is - the input stream from which this object will be read
Throws:
java.io.IOException - If an input exception occured

Method Detail

initialize

public void initialize(AlgorithmIdentifier algID,
                       ASN1Object contents)
                throws AlgorithmIdentifierException,
                       InvalidInputException
Specified by:
initialize in interface PublicKey
Throws:
AlgorithmIdentifierException
InvalidInputException

getAlgID

public AlgorithmIdentifier getAlgID()
Specified by:
getAlgID in interface PublicKey

getContents

public ASN1Object getContents()
Specified by:
getContents in interface PublicKey

getFormat

public java.lang.String getFormat()
Returns a string which indicates the format of this object's encoding.
Specified by:
getFormat in interface Key
Returns:
"X.509"

erase

public void erase()
Description copied from interface: Key
Erases the key material, making the key un-usable.

Keys can be erased multiple times with no consequence.

Specified by:
erase in interface Key

clone

public java.lang.Object clone()
Description copied from interface: Key
Performs a deep clone of the Key instance.
Specified by:
clone in interface Key
Specified by:
clone in class DHKey

setParams

public void setParams(DHParams params)
Description copied from class: DHKey
Sets the parameters for the Diffie-Hellman key. This method is used to set Diffie-Hellman parameters common to a group of users which are known from application context.
Specified by:
setParams in class DHKey
Parameters:
params - An instance of DHParams.

getY

public java.math.BigInteger getY()
Gets the public key value y.
Returns:
The public key value y.

toString

public java.lang.String toString()
Returns a string representation of this object.
Returns:
A string representation of this object.

input

public void input(java.io.InputStream is)
           throws java.io.IOException
Inputs a DHPublicKey object by reading its encoding from the given input stream.
Specified by:
input in interface Streamable
Parameters:
is - The input stream from which this object will be read
Throws:
java.io.IOException - If an input exception occured.

output

public void output(java.io.OutputStream os)
            throws java.io.IOException
Outputs the ASN1 encoding of this object to a given output stream.
Specified by:
output in interface Streamable
Parameters:
os - The output stream to which the encoding of this object will be written.
Throws:
java.io.IOException - If an output exception occured.

length

public int length()
Gets the length of the encoding of this object.
Specified by:
length in interface Streamable
Returns:
The length of the ASN1 encoding of this object.

Oracle Security Developer Tools Crypto Java API Reference
10g (10.1.4.0.1)

B28171-01


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