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

Quick Search    Search Deep

gnu.java.security.key.dss
Class DSSPublicKey  view DSSPublicKey download DSSPublicKey.java

java.lang.Object
  extended bygnu.java.security.key.dss.DSSKey
      extended bygnu.java.security.key.dss.DSSPublicKey
All Implemented Interfaces:
java.security.interfaces.DSAKey, java.security.interfaces.DSAPublicKey, java.security.Key, java.security.PublicKey, java.io.Serializable

public class DSSPublicKey
extends DSSKey
implements java.security.PublicKey, java.security.interfaces.DSAPublicKey

An object that embodies a DSS (Digital Signature Standard) public key.


Field Summary
private  java.lang.String str
          String representation of this key.
private  java.math.BigInteger y
          y = gx mod p where x is the private part of the DSA key.
 
Fields inherited from class gnu.java.security.key.dss.DSSKey
defaultFormat, g, p, q
 
Fields inherited from interface java.security.PublicKey
serialVersionUID
 
Fields inherited from interface java.security.interfaces.DSAPublicKey
serialVersionUID
 
Constructor Summary
DSSPublicKey(java.math.BigInteger p, java.math.BigInteger q, java.math.BigInteger g, java.math.BigInteger y)
          Conveience constructor.
DSSPublicKey(int preferredFormat, java.math.BigInteger p, java.math.BigInteger q, java.math.BigInteger g, java.math.BigInteger y)
          Constructs a new instance of DSSPublicKey given the designated arguments.
 
Method Summary
 boolean equals(java.lang.Object obj)
          Returns true if the designated object is an instance of java.security.interfaces.DSAPublicKey and has the same DSS (Digital Signature Standard) 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()
          This method returns the value of the DSA public key
 java.lang.String toString()
          Convert this Object to a human-readable String.
static DSSPublicKey valueOf(byte[] k)
          A class method that takes the output of the encodePublicKey() method of a DSS 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.java.security.key.dss.DSSKey
getAlgorithm, getEncoded, getFormat, getParams
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.security.Key
getAlgorithm, getEncoded, getFormat
 
Methods inherited from interface java.security.interfaces.DSAKey
getParams
 

Field Detail

y

private final java.math.BigInteger y
y = gx mod p where x is the private part of the DSA key.


str

private transient java.lang.String str
String representation of this key. Cached for speed.

Constructor Detail

DSSPublicKey

public DSSPublicKey(java.math.BigInteger p,
                    java.math.BigInteger q,
                    java.math.BigInteger g,
                    java.math.BigInteger y)
Conveience constructor. Calls the constructor with 5 arguments passing Registry.RAW_ENCODING_ID>Registry.RAW_ENCODING_ID 55 as the identifier of the preferred encoding format.


DSSPublicKey

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

Method Detail

valueOf

public static DSSPublicKey valueOf(byte[] k)
A class method that takes the output of the encodePublicKey() method of a DSS 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: java.security.interfaces.DSAPublicKey
This method returns the value of the DSA public key

Specified by:
getY in interface java.security.interfaces.DSAPublicKey

getEncoded

public byte[] getEncoded(int format)

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

Specified by:
getEncoded in class DSSKey

equals

public boolean equals(java.lang.Object obj)

Returns true if the designated object is an instance of java.security.interfaces.DSAPublicKey and has the same DSS (Digital Signature Standard) parameter values as this one.

Overrides:
equals in class DSSKey

toString

public java.lang.String toString()
Description copied from class: java.lang.Object
Convert this Object to a human-readable String. There are no limits placed on how long this String should be or what it should contain. We suggest you make it as intuitive as possible to be able to place it into System.out.println() 55 and such.

It is typical, but not required, to ensure that this method never completes abruptly with a java.lang.RuntimeException.

This method will be called when performing string concatenation with this object. If the result is null, string concatenation will instead use "null".

The default implementation returns getClass().getName() + "@" + Integer.toHexString(hashCode()).

Overrides:
toString in class DSSKey