com.ibm.crypto.fips.provider
Class RSAPrivateCrtKey
- java.lang.Object
-
- com.ibm.security.pkcsutil.PKCSDerObject
-
- com.ibm.security.pkcs8.PrivateKeyInfo
-
- com.ibm.crypto.fips.provider.RSAPrivateCrtKey
-
- All Implemented Interfaces:
- java.io.Serializable, java.lang.Cloneable, java.security.interfaces.RSAKey, java.security.interfaces.RSAPrivateCrtKey, java.security.interfaces.RSAPrivateKey, java.security.Key, java.security.PrivateKey, javax.security.auth.Destroyable
public final class RSAPrivateCrtKey extends com.ibm.security.pkcs8.PrivateKeyInfo implements java.security.interfaces.RSAPrivateCrtKey, java.io.SerializableAn X.509 private crt key for the RSA Algorithm.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor and Description RSAPrivateCrtKey(java.math.BigInteger m, java.math.BigInteger privEx, java.math.BigInteger pubEx, java.math.BigInteger p, java.math.BigInteger q, java.math.BigInteger ex1, java.math.BigInteger ex2, java.math.BigInteger co)This constructor computes missing key values and formats key values.RSAPrivateCrtKey(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.BigIntegergetCrtCoefficient()Returns the crtCoefficient.java.math.BigIntegergetModulus()Return the modulus.java.math.BigIntegergetPrimeExponentP()Returns the primeExponentP.java.math.BigIntegergetPrimeExponentQ()Returns the primeExponentQ.java.math.BigIntegergetPrimeP()Returns the primeP.java.math.BigIntegergetPrimeQ()Returns the primeQ.java.math.BigIntegergetPrivateExponent()Return the private exponent.java.math.BigIntegergetPublicExponent()Returns the public 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
-
RSAPrivateCrtKey
public RSAPrivateCrtKey(java.math.BigInteger m, java.math.BigInteger privEx, java.math.BigInteger pubEx, java.math.BigInteger p, java.math.BigInteger q, java.math.BigInteger ex1, java.math.BigInteger ex2, java.math.BigInteger co) throws java.security.InvalidKeyExceptionThis constructor computes missing key values and formats key values. The slots of missing values should be BigInteger.ZERO. The parametrers required for computation are listed below.- Parameters:
key:-- 0: modulus (requires: prime1, prime2)
- 1: private exponent (requires: public exp, prime1, prime2)
- 2: public exponent
- 3: prime1 (p)
- 4: prime2 (q)
- 5: exponent1 (requires: private exponent, prime1)
- 6: exponent2 (requires: private exponent, prime2)
- 7: coefficient (requires: prime1, prime2)
- Throws:
java.security.InvalidKeyException
-
RSAPrivateCrtKey
public RSAPrivateCrtKey(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
-
getPublicExponent
public java.math.BigInteger getPublicExponent()
Returns the public exponent.- Specified by:
getPublicExponentin interfacejava.security.interfaces.RSAPrivateCrtKey
-
getPrimeP
public java.math.BigInteger getPrimeP()
Returns the primeP.- Specified by:
getPrimePin interfacejava.security.interfaces.RSAPrivateCrtKey
-
getPrimeQ
public java.math.BigInteger getPrimeQ()
Returns the primeQ.- Specified by:
getPrimeQin interfacejava.security.interfaces.RSAPrivateCrtKey
-
getPrimeExponentP
public java.math.BigInteger getPrimeExponentP()
Returns the primeExponentP.- Specified by:
getPrimeExponentPin interfacejava.security.interfaces.RSAPrivateCrtKey
-
getPrimeExponentQ
public java.math.BigInteger getPrimeExponentQ()
Returns the primeExponentQ.- Specified by:
getPrimeExponentQin interfacejava.security.interfaces.RSAPrivateCrtKey
-
getCrtCoefficient
public java.math.BigInteger getCrtCoefficient()
Returns the crtCoefficient.- Specified by:
getCrtCoefficientin interfacejava.security.interfaces.RSAPrivateCrtKey
-
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
-
-