public final class DSAPrivateKey extends PKCS8Key implements java.security.interfaces.DSAPrivateKey, java.io.Serializable
DSAPublicKey
,
AlgIdDSA
,
Serialized Formalgid, encodedKey, key, VERSION
Constructor and Description |
---|
DSAPrivateKey() |
DSAPrivateKey(java.math.BigInteger x,
java.math.BigInteger p,
java.math.BigInteger q,
java.math.BigInteger g)
Make a DSA private key out of a private key and three parameters.
|
DSAPrivateKey(byte[] encoded)
Make a DSA private key from its DER encoding (PKCS #8).
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(java.lang.Object obj)
Compares two private keys.
|
java.security.interfaces.DSAParams |
getParams()
Returns the DSA parameters associated with this key, or null if the
parameters could not be parsed.
|
java.math.BigInteger |
getX()
Get the raw private key, x, without the parameters.
|
int |
hashCode()
Calculates a hash code value for this object.
|
protected void |
parseKeyBits()
Parse the key bits.
|
java.lang.String |
toString() |
buildPKCS8Key, decode, decode, encode, encode, getAlgorithm, getAlgorithmId, getEncoded, getFormat, parse
public DSAPrivateKey()
public DSAPrivateKey(java.math.BigInteger x, java.math.BigInteger p, java.math.BigInteger q, java.math.BigInteger g) throws java.security.InvalidKeyException
java.security.InvalidKeyException
public DSAPrivateKey(byte[] encoded) throws java.security.InvalidKeyException
java.security.InvalidKeyException
public java.security.interfaces.DSAParams getParams()
getParams
in interface java.security.interfaces.DSAKey
public java.math.BigInteger getX()
getX
in interface java.security.interfaces.DSAPrivateKey
protected void parseKeyBits() throws java.security.InvalidKeyException
PKCS8Key
key
bits; Diffie-Hellman and
DSS/DSA keys encapsulate a single unsigned integer.
This function is called when creating PKCS#8 SubjectPublicKeyInfo values using the PKCS8Key member functions,
such as parse
and decode
.
parseKeyBits
in class PKCS8Key
java.security.InvalidKeyException
- if the key encoding is invalid.public int hashCode()
PKCS8Key
public boolean equals(java.lang.Object obj)
PKCS8Key
Key
.
Otherwise, the encoding of this key object is compared with the
encoding of the given key object.