Prev Class | Next Class | Frames | No Frames |
Summary: Nested | Field | Method | Constr | Detail: Nested | Field | Method | Constr |
java.lang.Object
gnu.java.security.key.dss.DSSKey
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.
IMPORTANT: Under certain circumstances (e.g. in an X.509 certificate
with inherited AlgorithmIdentifier's parameters of a SubjectPublicKeyInfo
element) these three MPIs may be null
.
Field Summary | |
protected int |
|
protected BigInteger |
|
protected BigInteger |
|
protected BigInteger |
|
Fields inherited from interface java.security.Key | |
serialVersionUID |
Constructor Summary | |
|
Method Summary | |
boolean | |
String | |
byte[] |
|
abstract byte[] |
|
String | |
DSAParams |
|
boolean | |
String |
|
Methods inherited from class java.lang.Object | |
clone , equals , extends Object> getClass , finalize , hashCode , notify , notifyAll , toString , wait , wait , wait |
protected final int defaultFormat
Identifier of the default encoding format to use when externalizing the key material.
protected final BigInteger g
g = h(p-1)/q mod p
, whereh
is any integer with1 < h < p - 1
such thath (p-1)/q mod p > 1
(g
has orderq mod p
).
protected final BigInteger p
A prime modulus, where2L-1 < p < 2L
for512 <= L <= 1024
andL
a multiple of64
.
protected DSSKey(int defaultFormat, BigInteger p, BigInteger q, BigInteger g)
Trivial protected constructor.
- Parameters:
defaultFormat
- the identifier of the encoding format to use by default when externalizing the key.p
- the DSS parameterp
.q
- the DSS parameterq
.g
- the DSS parameterg
.
public boolean equals(Object obj)
Returnstrue
if the designated object is an instance ofDSAKey
and has the same DSS (Digital Signature Standard) parameter values as this one.Always returns
false
if the MPIs of this key are inherited. This may be the case when the key is re-constructed from an X.509 certificate with absent or NULL AlgorithmIdentifier's parameters field.
- 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.
public byte[] getEncoded()
Deprecated. see getEncoded(int).
- Specified by:
- getEncoded in interface Key
public DSAParams getParams()
This method returns non-secret parameters of the DSA key
- Returns:
- The DSA parameters
public boolean hasInheritedParameters()
- Returns:
true
ifp
,q
andg
are allnull
. Returnsfalse
otherwise.
public String toString()
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 intoSystem.out.println()
and such.It is typical, but not required, to ensure that this method never completes abruptly with a
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())
.
- Returns:
- the String representing this Object, which may be null
- See Also:
getClass()
,Object.hashCode()
,Class.getName()
,Integer.toHexString(int)