gnu.crypto.key.dss

Class DSSKey

Implemented Interfaces:
DSAKey, Key
Known Direct Subclasses:
DSSPrivateKey, DSSPublicKey

public abstract class DSSKey
extends java.lang.Object
implements Key, DSAKey

A base asbtract class for both public and private DSS (Digital Signature Standard) keys. It encapsulates the three DSS numbers: p, q and g.

According to the JDK, cryptographic Keys all have a format. The format used in this implementation is called Raw, and basically consists of the raw byte sequences of algorithm parameters. The exact order of the byte sequences and the implementation details are given in each of the relevant getEncoded() methods of each of the private and public keys.

Version:
$Revision: 1.1 $

See Also:
DSSPrivateKey.getEncoded(int), DSSPublicKey.getEncoded(int)

Field Summary

protected BigInteger
g
g = h(p-1)/q mod p, where h is any integer with 1 < h < p - 1 such that h (p-1)/q mod p > 1 (g has order q mod p ).
protected BigInteger
p
A prime modulus, where 2L-1 < p < 2L for 512 <= L <= 1024 and L a multiple of 64.
protected BigInteger
q
A prime divisor of p - 1, where 2159 < q < 2160.

Constructor Summary

DSSKey(BigInteger p, BigInteger q, BigInteger g)
Trivial protected constructor.

Method Summary

boolean
equals(Object obj)
Returns true if the designated object is an instance of DSAKey and has the same DSS (Digital Signature Standard) parameter values as this one.
String
getAlgorithm()
byte[]
getEncoded()
Deprecated. see getEncoded(int).
byte[]
getEncoded(int format)
String
getFormat()
DSAParams
getParams()

Field Details

g

protected final BigInteger g
g = h(p-1)/q mod p, where h is any integer with 1 < h < p - 1 such that h (p-1)/q mod p > 1 (g has order q mod p ).


p

protected final BigInteger p
A prime modulus, where 2L-1 < p < 2L for 512 <= L <= 1024 and L a multiple of 64.


q

protected final BigInteger q
A prime divisor of p - 1, where 2159 < q < 2160.

Constructor Details

DSSKey

protected DSSKey(BigInteger p,
                 BigInteger q,
                 BigInteger g)
Trivial protected constructor.

Parameters:
p - the DSS parameter p.
q - the DSS parameter q.
g - the DSS parameter g.

Method Details

equals

public boolean equals(Object obj)
Returns true if the designated object is an instance of DSAKey and has the same DSS (Digital Signature Standard) parameter values as this one.

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.


getAlgorithm

public String getAlgorithm()


getEncoded

public byte[] getEncoded()

Deprecated. see getEncoded(int).


getEncoded

public byte[] getEncoded(int format)


getFormat

public String getFormat()


getParams

public DSAParams getParams()


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