com.ibm.crypto.fips.provider
Class RSAPrivateKey
- java.lang.Object
-
- com.ibm.security.pkcsutil.PKCSDerObject
-
- com.ibm.security.pkcs8.PrivateKeyInfo
-
- com.ibm.crypto.fips.provider.RSAPrivateKey
-
- All Implemented Interfaces:
- java.io.Serializable, java.lang.Cloneable, java.security.interfaces.RSAKey, java.security.interfaces.RSAPrivateKey, java.security.Key, java.security.PrivateKey, javax.security.auth.Destroyable
public final class RSAPrivateKey extends com.ibm.security.pkcs8.PrivateKeyInfo implements java.security.interfaces.RSAPrivateKey, java.io.SerializableAn X.509 private key for the RSA Algorithm.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor and Description RSAPrivateKey(java.math.BigInteger m, java.math.BigInteger p)Make a RSA private key.RSAPrivateKey(byte[] encoded)Make a RSA private key from its 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.math.BigIntegergetModulus()Return the modulus.java.math.BigIntegergetPrivateExponent()Return the private exponent.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
-
RSAPrivateKey
public RSAPrivateKey(java.math.BigInteger m, java.math.BigInteger p) throws java.security.InvalidKeyExceptionMake a RSA private key.- Throws:
java.security.InvalidKeyException
-
RSAPrivateKey
public RSAPrivateKey(byte[] encoded) throws java.security.InvalidKeyExceptionMake a RSA private key from its DER encoding (PKCS #8).- Throws:
java.security.InvalidKeyException
-
-
Method Detail
-
getModulus
public java.math.BigInteger getModulus()
Return the modulus.- Specified by:
getModulusin interfacejava.security.interfaces.RSAKey
-
getPrivateExponent
public java.math.BigInteger getPrivateExponent()
Return the private exponent.- Specified by:
getPrivateExponentin interfacejava.security.interfaces.RSAPrivateKey
-
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
-
-