Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

gnu.javax.crypto.key.dh
Class GnuDHPrivateKey  view GnuDHPrivateKey download GnuDHPrivateKey.java

java.lang.Object
  extended bygnu.javax.crypto.key.dh.GnuDHKey
      extended bygnu.javax.crypto.key.dh.GnuDHPrivateKey
All Implemented Interfaces:
javax.crypto.interfaces.DHKey, javax.crypto.interfaces.DHPrivateKey, java.security.Key, java.security.PrivateKey, java.io.Serializable

public class GnuDHPrivateKey
extends GnuDHKey
implements javax.crypto.interfaces.DHPrivateKey

An implementation of the Diffie-Hellman private key.

Reference:

  1. Diffie-Hellman Key Agreement Method
    Eric Rescorla.


Field Summary
private  java.math.BigInteger x
          The private exponent.
 
Fields inherited from class gnu.javax.crypto.key.dh.GnuDHKey
defaultFormat, g, p, q
 
Fields inherited from interface javax.crypto.interfaces.DHPrivateKey
serialVersionUID
 
Constructor Summary
GnuDHPrivateKey(java.math.BigInteger q, java.math.BigInteger p, java.math.BigInteger g, java.math.BigInteger x)
          Convenience constructor.
GnuDHPrivateKey(int preferredFormat, java.math.BigInteger q, java.math.BigInteger p, java.math.BigInteger g, java.math.BigInteger x)
          Constructs a new instance of GnuDHPrivateKey given the designated parameters.
 
Method Summary
 boolean equals(java.lang.Object obj)
          Returns true if the designated object is an instance of javax.crypto.interfaces.DHPrivateKey and has the same parameter values as this one.
 byte[] getEncoded(int format)
          Returns the encoded form of this private key according to the designated format.
 java.math.BigInteger getX()
          Returns the private value x.
static GnuDHPrivateKey valueOf(byte[] k)
          A class method that takes the output of the encodePrivateKey() method of a DH keypair codec object (an instance implementing gnu.java.security.key.IKeyPairCodec for DH keys, and re-constructs an instance of this object.
 
Methods inherited from class gnu.javax.crypto.key.dh.GnuDHKey
getAlgorithm, getEncoded, getFormat, getParams, getQ
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface javax.crypto.interfaces.DHKey
getParams
 
Methods inherited from interface java.security.Key
getAlgorithm, getEncoded, getFormat
 

Field Detail

x

private final java.math.BigInteger x
The private exponent.

Constructor Detail

GnuDHPrivateKey

public GnuDHPrivateKey(java.math.BigInteger q,
                       java.math.BigInteger p,
                       java.math.BigInteger g,
                       java.math.BigInteger x)
Convenience constructor. Calls the constructor with five arguments passing Registry.RAW_ENCODING_ID>Registry.RAW_ENCODING_ID 55 as the value of its first argument.


GnuDHPrivateKey

public GnuDHPrivateKey(int preferredFormat,
                       java.math.BigInteger q,
                       java.math.BigInteger p,
                       java.math.BigInteger g,
                       java.math.BigInteger x)
Constructs a new instance of GnuDHPrivateKey given the designated parameters.

Method Detail

valueOf

public static GnuDHPrivateKey valueOf(byte[] k)

A class method that takes the output of the encodePrivateKey() method of a DH keypair codec object (an instance implementing gnu.java.security.key.IKeyPairCodec for DH keys, and re-constructs an instance of this object.


getX

public java.math.BigInteger getX()
Description copied from interface: javax.crypto.interfaces.DHPrivateKey
Returns the private value x.

Specified by:
getX in interface javax.crypto.interfaces.DHPrivateKey

getEncoded

public byte[] getEncoded(int format)

Returns the encoded form of this private key according to the designated format.

Specified by:
getEncoded in class GnuDHKey

equals

public boolean equals(java.lang.Object obj)
Returns true if the designated object is an instance of javax.crypto.interfaces.DHPrivateKey and has the same parameter values as this one.

Overrides:
equals in class GnuDHKey