Class DSAPrivateKey
java.lang.Object
org.mozilla.jss.netscape.security.pkcs.PKCS8Key
org.mozilla.jss.netscape.security.provider.DSAPrivateKey
- All Implemented Interfaces:
Serializable
,DSAKey
,DSAPrivateKey
,Key
,PrivateKey
,Destroyable
A PKCS#8 private key for the Digital Signature Algorithm.
- Version:
- 1.47, 97/12/10
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final long
use serialVersionUID from JDK 1.1.private BigInteger
Fields inherited from class org.mozilla.jss.netscape.security.pkcs.PKCS8Key
algid, encodedKey, key, VERSION
-
Constructor Summary
ConstructorsConstructorDescriptionDSAPrivateKey
(byte[] encoded) Make a DSA private key from its DER encoding (PKCS #8).DSAPrivateKey
(BigInteger x, BigInteger p, BigInteger q, BigInteger g) Make a DSA private key out of a private key and three parameters. -
Method Summary
Modifier and TypeMethodDescriptionprivate void
boolean
Compares two private keys.Returns the DSA parameters associated with this key, or null if the parameters could not be parsed.getX()
Get the raw private key, x, without the parameters.int
hashCode()
Calculates a hash code value for this object.protected void
Parse the key bits.toString()
Methods inherited from class org.mozilla.jss.netscape.security.pkcs.PKCS8Key
buildPKCS8Key, decode, decode, encode, encode, getAlgorithm, getAlgorithmId, getEncoded, getFormat, parse
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface javax.security.auth.Destroyable
destroy, isDestroyed
Methods inherited from interface java.security.Key
getAlgorithm, getEncoded, getFormat
-
Field Details
-
serialVersionUID
private static final long serialVersionUIDuse serialVersionUID from JDK 1.1. for interoperability- See Also:
-
x
-
-
Constructor Details
-
DSAPrivateKey
public DSAPrivateKey() -
DSAPrivateKey
public DSAPrivateKey(BigInteger x, BigInteger p, BigInteger q, BigInteger g) throws InvalidKeyException Make a DSA private key out of a private key and three parameters.- Throws:
InvalidKeyException
-
DSAPrivateKey
Make a DSA private key from its DER encoding (PKCS #8).- Throws:
InvalidKeyException
-
-
Method Details
-
getParams
Returns the DSA parameters associated with this key, or null if the parameters could not be parsed. -
getX
Get the raw private key, x, without the parameters.- Specified by:
getX
in interfaceDSAPrivateKey
-
clearOldKey
private void clearOldKey() -
toString
-
parseKeyBits
Description copied from class:PKCS8Key
Parse the key bits. This may be redefined by subclasses to take advantage of structure within the key. For example, RSA public keys encapsulate two unsigned integers (modulus and exponent) as DER values within thekey
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
anddecode
.- Overrides:
parseKeyBits
in classPKCS8Key
- Throws:
InvalidKeyException
- if the key encoding is invalid.
-
hashCode
public int hashCode()Description copied from class:PKCS8Key
Calculates a hash code value for this object. Objects which are equal will also have the same hashcode. -
equals
Description copied from class:PKCS8Key
Compares two private keys. This returns false if the object with which to compare is not of typeKey
. Otherwise, the encoding of this key object is compared with the encoding of the given key object.
-