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 longuse serialVersionUID from JDK 1.1.private BigIntegerFields 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 voidbooleanCompares 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.inthashCode()Calculates a hash code value for this object.protected voidParse the key bits.toString()Methods inherited from class org.mozilla.jss.netscape.security.pkcs.PKCS8Key
buildPKCS8Key, decode, decode, encode, encode, getAlgorithm, getAlgorithmId, getEncoded, getFormat, parseMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface javax.security.auth.Destroyable
destroy, isDestroyedMethods 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:
getXin interfaceDSAPrivateKey
-
clearOldKey
private void clearOldKey() -
toString
-
parseKeyBits
Description copied from class:PKCS8KeyParse 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 thekeybits; 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
parseanddecode.- Overrides:
parseKeyBitsin classPKCS8Key- Throws:
InvalidKeyException- if the key encoding is invalid.
-
hashCode
public int hashCode()Description copied from class:PKCS8KeyCalculates a hash code value for this object. Objects which are equal will also have the same hashcode. -
equals
Description copied from class:PKCS8KeyCompares 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.
-