com.ibm.crypto.fips.provider
Class DSAPrivateKey
- java.lang.Object
-
- com.ibm.security.pkcsutil.PKCSDerObject
-
- com.ibm.security.pkcs8.PrivateKeyInfo
-
- com.ibm.crypto.fips.provider.DSAPrivateKey
-
- All Implemented Interfaces:
- java.io.Serializable, java.lang.Cloneable, java.security.interfaces.DSAKey, java.security.interfaces.DSAPrivateKey, java.security.Key, java.security.PrivateKey, javax.security.auth.Destroyable
public final class DSAPrivateKey extends com.ibm.security.pkcs8.PrivateKeyInfo implements java.security.interfaces.DSAPrivateKey, java.io.SerializableThis class represents an X.509 private key for the DSA Algorithm.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor and Description DSAPrivateKey(java.math.BigInteger x, java.math.BigInteger p, java.math.BigInteger q, java.math.BigInteger g)Create a DSA private key from x, p, q, and g.DSAPrivateKey(byte[] encoded)Create a DSA private key from it's DER encoding (PKCS#8)
-
Method Summary
Methods Modifier and Type Method and Description protected voidfinalize()This function zeroizes the key so that it isn't in memory when GC is done.java.security.interfaces.DSAParamsgetParams()Returns the DSA parameters associated with this key, or null if the parameters could not be parsed.java.math.BigIntegergetX()Return the value of the private key.protected voidparseKeyBits()voidzeroize()This function zeroizes the key so that it isn't in memory-
Methods inherited from class com.ibm.security.pkcs8.PrivateKeyInfo
addAttribute, addAttributes, clone, decode, encode, equals, getAlgorithm, getAlgorithmId, getAttribute, getAttributes, getEncoded, getFormat, getKeyBytes, hasAttribute, hasAttributes, hashCode, parseKey, parseKey, toString
-
-
-
-
Constructor Detail
-
DSAPrivateKey
public DSAPrivateKey(java.math.BigInteger x, java.math.BigInteger p, java.math.BigInteger q, java.math.BigInteger g) throws java.security.InvalidKeyExceptionCreate a DSA private key from x, p, q, and g.- Parameters:
x- the private keyp- the number pq- the number qg- the number g- Throws:
java.security.InvalidKeyException
-
DSAPrivateKey
public DSAPrivateKey(byte[] encoded) throws java.security.InvalidKeyExceptionCreate a DSA private key from it's DER encoding (PKCS#8)- Parameters:
encoded- the encoded parameters.- Throws:
java.security.InvalidKeyException
-
-
Method Detail
-
getParams
public java.security.interfaces.DSAParams getParams()
Returns the DSA parameters associated with this key, or null if the parameters could not be parsed.- Specified by:
getParamsin interfacejava.security.interfaces.DSAKey- Returns:
- DSAParams the DSA parameter of this instance
-
getX
public java.math.BigInteger getX()
Return the value of the private key.- Specified by:
getXin interfacejava.security.interfaces.DSAPrivateKey- Returns:
- BigInteger the value of x
-
parseKeyBits
protected void parseKeyBits() throws java.io.IOException- Overrides:
parseKeyBitsin classcom.ibm.security.pkcs8.PrivateKeyInfo- Throws:
java.io.IOException
-
zeroize
public void zeroize()
This function zeroizes the key so that it isn't in memory
-
finalize
protected void finalize()
This function zeroizes the key so that it isn't in memory when GC is done.- Overrides:
finalizein classcom.ibm.security.pkcs8.PrivateKeyInfo
-
-