gnu.crypto.sig.dss
Class DSSPublicKey
java.lang.Object
|
+--gnu.crypto.sig.dss.DSSKey
|
+--gnu.crypto.sig.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 encapsulates a DSS (Digital Signature Standard) public key.
- Version:
- $Revision: 1.2 $
- See Also:
getEncoded()
, Serialized Form
Fields inherited from class gnu.crypto.sig.dss.DSSKey |
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)
Trivial constructor. |
Method Summary |
boolean |
equals(java.lang.Object obj)
Returns true if the designated object is an instance of
DSAPublicKey and has the same DSS
(Digital Signature Standard) parameter values as this one. |
byte[] |
getEncoded()
Deprecated. see getEncoded(int). |
byte[] |
getEncoded(int format)
Returns the encoded form of this public key according to the designated
format. |
java.math.BigInteger |
getY()
|
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
IKeyPairCodec for DSS keys, and re-constructs an
instance of this object. |
Methods inherited from class java.lang.Object |
, clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface java.security.Key |
getAlgorithm, getFormat |
Methods inherited from interface java.security.interfaces.DSAKey |
getParams |
DSSPublicKey
public DSSPublicKey(java.math.BigInteger p,
java.math.BigInteger q,
java.math.BigInteger g,
java.math.BigInteger y)
- Trivial constructor.
- Parameters:
p
- the public modulus.q
- the public prime divisor of p-1
.g
- a generator of the unique cyclic group Z*
p
.y
- the public key part.
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
IKeyPairCodec
for DSS keys, and re-constructs an
instance of this object.
- Parameters:
k
- the contents of a previously encoded instance of this object.- Throws:
ArrayIndexOutOfBoundsException
- if there is not enough bytes,
in k
, to represent a valid encoding of an instance of
this object.java.lang.IllegalArgumentException
- if the byte sequence does not
represent a valid encoding of an instance of this object.
getY
public java.math.BigInteger getY()
- Specified by:
getY
in interface java.security.interfaces.DSAPublicKey
getEncoded
public byte[] getEncoded()
- Deprecated. see getEncoded(int).
- Specified by:
getEncoded
in interface java.security.Key
getEncoded
public byte[] getEncoded(int format)
- Returns the encoded form of this public key according to the designated
format.
- Parameters:
format
- the desired format identifier of the resulting encoding.- Returns:
- the byte sequence encoding this key according to the designated
format.
- Throws:
java.lang.IllegalArgumentException
- if the format is not supported.- See Also:
DSSKeyPairRawCodec
equals
public boolean equals(java.lang.Object obj)
- Returns
true
if the designated object is an instance of
DSAPublicKey
and has the same DSS
(Digital Signature Standard) parameter values as this one.
- Overrides:
equals
in class DSSKey
- Parameters:
obj
- the other non-null DSS key to compare to.- Returns:
true
if the designated object is of the same type and
value as this one.
Copyright ©2001-2002
Free Software Foundation, Inc.. All Rights Reserved.