gnu.crypto.key.dss

Class DSSPrivateKey

Implemented Interfaces:
DSAKey, DSAPrivateKey, Key, PrivateKey

public class DSSPrivateKey
extends DSSKey
implements PrivateKey, DSAPrivateKey

An object that embodies a DSS (Digital Signature Standard) private key.
Version:
$Revision: 1.2 $
See Also:
getEncoded(int)

Field Summary

Fields inherited from class gnu.crypto.key.dss.DSSKey

g, p, q

Constructor Summary

DSSPrivateKey(BigInteger p, BigInteger q, BigInteger g, BigInteger x)
Trivial constructor.

Method Summary

boolean
equals(Object obj)
Returns true if the designated object is an instance of DSAPrivateKey and has the same DSS (Digital Signature Standard) parameter values as this one.
byte[]
getEncoded(int format)
Returns the encoded form of this private key according to the designated format.
BigInteger
getX()
static DSSPrivateKey
valueOf(byte[] k)
A class method that takes the output of the encodePrivateKey() 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 gnu.crypto.key.dss.DSSKey

equals, getAlgorithm, getEncoded, getEncoded, getFormat, getParams

Constructor Details

DSSPrivateKey

public DSSPrivateKey(BigInteger p,
                     BigInteger q,
                     BigInteger g,
                     BigInteger x)
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.
x - the private key part.

Method Details

equals

public boolean equals(Object obj)
Returns true if the designated object is an instance of DSAPrivateKey and has the same DSS (Digital Signature Standard) parameter values as this one.
Overrides:
equals in interface 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.

getEncoded

public byte[] getEncoded(int format)
Returns the encoded form of this private key according to the designated format.
Overrides:
getEncoded in interface DSSKey
Parameters:
format - the desired format identifier of the resulting encoding.
Returns:
the byte sequence encoding this key according to the designated format.

getX

public BigInteger getX()

valueOf

public static DSSPrivateKey valueOf(byte[] k)
A class method that takes the output of the encodePrivateKey() 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.

Copyright © 2001, 2002, 2003 Free Software Foundation, Inc. All Rights Reserved.