Package org.bouncycastle.crypto.params
Class RSAKeyParameters
- java.lang.Object
-
- org.bouncycastle.crypto.params.AsymmetricKeyParameter
-
- org.bouncycastle.crypto.params.RSAKeyParameters
-
- All Implemented Interfaces:
javax.security.auth.Destroyable,CipherParameters
- Direct Known Subclasses:
RSAPrivateCrtKeyParameters
public class RSAKeyParameters extends AsymmetricKeyParameter implements javax.security.auth.Destroyable
-
-
Constructor Summary
Constructors Constructor Description RSAKeyParameters(boolean isPrivate, java.math.BigInteger modulus, java.math.BigInteger exponent)RSAKeyParameters(boolean isPrivate, java.math.BigInteger modulus, java.math.BigInteger exponent, boolean isInternal)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voiddestroy()Destroy this object, dropping its reference to the exponent.java.math.BigIntegergetExponent()java.math.BigIntegergetModulus()booleanisDestroyed()static java.math.BigIntegervalidateModulus(java.math.BigInteger modulus)-
Methods inherited from class org.bouncycastle.crypto.params.AsymmetricKeyParameter
isPrivate
-
-
-
-
Method Detail
-
validateModulus
public static java.math.BigInteger validateModulus(java.math.BigInteger modulus)
-
getModulus
public java.math.BigInteger getModulus()
-
getExponent
public java.math.BigInteger getExponent()
-
destroy
public void destroy()
Destroy this object, dropping its reference to the exponent. The (public) modulus is retained.As
BigIntegeris immutable the exponent cannot be zeroized in place; destruction drops the internal reference so the value becomes unreachable (cleared on garbage collection). After destructiongetExponent()throwsIllegalStateException.This type also backs RSA public keys; destroying one of those drops the (non-secret) public exponent, which is harmless but renders the key unusable.
- Specified by:
destroyin interfacejavax.security.auth.Destroyable
-
isDestroyed
public boolean isDestroyed()
- Specified by:
isDestroyedin interfacejavax.security.auth.Destroyable
-
-