Save This Page
Home » openjdk-7 » com.sun.crypto » provider » [javadoc | source]
com.sun.crypto.provider
final class: DHPrivateKey [javadoc | source]
java.lang.Object
   com.sun.crypto.provider.DHPrivateKey

All Implemented Interfaces:
    DHPrivateKey, Serializable, PrivateKey

A private key in PKCS#8 format for the Diffie-Hellman key agreement algorithm.
Field Summary
static final  long serialVersionUID     
Constructor:
 DHPrivateKey(byte[] encodedKey) throws InvalidKeyException 
    Make a DH private key from its DER encoding (PKCS #8).
    Parameters:
    encodedKey - the encoded key
    Throws:
    InvalidKeyException - if the encoded key does not represent a Diffie-Hellman private key
    exception: InvalidKeyException - if the encoded key does not represent a Diffie-Hellman private key
 DHPrivateKey(BigInteger x,
    BigInteger p,
    BigInteger g) throws InvalidKeyException 
    Make a DH private key out of a private value x, a prime modulus p, and a base generator g.
    Parameters:
    x - the private value
    p - the prime modulus
    g - the base generator
    Throws:
    ProviderException - if the key cannot be encoded
    exception: ProviderException - if the key cannot be encoded
 DHPrivateKey(BigInteger x,
    BigInteger p,
    BigInteger g,
    int l) 
    Make a DH private key out of a private value x, a prime modulus p, a base generator g, and a private-value length l.
    Parameters:
    x - the private value
    p - the prime modulus
    g - the base generator
    l - the private-value length
    Throws:
    InvalidKeyException - if the key cannot be encoded
    exception: InvalidKeyException - if the key cannot be encoded
Method from com.sun.crypto.provider.DHPrivateKey Summary:
equals,   getAlgorithm,   getEncoded,   getFormat,   getParams,   getX,   hashCode,   toString
Methods from java.lang.Object:
clone,   equals,   finalize,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from com.sun.crypto.provider.DHPrivateKey Detail:
 public boolean equals(Object obj) 
 public String getAlgorithm() 
    Returns the name of the algorithm associated with this key: "DH"
 public synchronized byte[] getEncoded() 
    Get the encoding of the key.
 public String getFormat() 
    Returns the encoding format of this key: "PKCS#8"
 public DHParameterSpec getParams() 
    Returns the key parameters.
 public BigInteger getX() 
    Returns the private value, x.
 public int hashCode() 
    Calculates a hash code value for the object. Objects that are equal will also have the same hashcode.
 public String toString()