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

Quick Search    Search Deep

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

java.lang.Object
  extended bygnu.javax.crypto.key.dh.GnuDHKey
      extended bygnu.javax.crypto.key.dh.GnuDHPublicKey
All Implemented Interfaces:
javax.crypto.interfaces.DHKey, javax.crypto.interfaces.DHPublicKey, java.security.Key, java.security.PublicKey, java.io.Serializable

public class GnuDHPublicKey
extends GnuDHKey
implements javax.crypto.interfaces.DHPublicKey

An implementation of the Diffie-Hellman public key.

Reference:

  1. Diffie-Hellman Key Agreement Method
    Eric Rescorla.


Field Summary
private  java.math.BigInteger y
           
 
Fields inherited from class gnu.javax.crypto.key.dh.GnuDHKey
defaultFormat, g, p, q
 
Fields inherited from interface javax.crypto.interfaces.DHPublicKey
serialVersionUID
 
Constructor Summary
GnuDHPublicKey(java.math.BigInteger q, java.math.BigInteger p, java.math.BigInteger g, java.math.BigInteger y)
          Convenience constructor.
GnuDHPublicKey(int preferredFormat, java.math.BigInteger q, java.math.BigInteger p, java.math.BigInteger g, java.math.BigInteger y)
          Constructs a new instance of GnuDHPublicKey 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.DHPublicKey and has the same parameter values as this one.
 byte[] getEncoded(int format)
          Returns the encoded form of this public key according to the designated format.
 java.math.BigInteger getY()
          Get the public value y.
static GnuDHPublicKey valueOf(byte[] k)
          A class method that takes the output of the encodePublicKey() method of a DH keypair codec object (an instance implementing gnu.java.security.key.IKeyPairCodec for DSS 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

y

private java.math.BigInteger y
Constructor Detail

GnuDHPublicKey

public GnuDHPublicKey(java.math.BigInteger q,
                      java.math.BigInteger p,
                      java.math.BigInteger g,
                      java.math.BigInteger y)
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.


GnuDHPublicKey

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

Method Detail

valueOf

public static GnuDHPublicKey valueOf(byte[] k)

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


getY

public java.math.BigInteger getY()
Description copied from interface: javax.crypto.interfaces.DHPublicKey
Get the public value y.

Specified by:
getY in interface javax.crypto.interfaces.DHPublicKey

getEncoded

public byte[] getEncoded(int format)

Returns the encoded form of this public 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.DHPublicKey and has the same parameter values as this one.

Overrides:
equals in class GnuDHKey