Class RSAKeyParameters
java.lang.Object
org.bouncycastle.crypto.params.AsymmetricKeyParameter
org.bouncycastle.crypto.params.RSAKeyParameters
- All Implemented Interfaces:
Destroyable, CipherParameters
- Direct Known Subclasses:
RSAPrivateCrtKeyParameters
-
Constructor Summary
ConstructorsConstructorDescriptionRSAKeyParameters(boolean isPrivate, BigInteger modulus, BigInteger exponent) RSAKeyParameters(boolean isPrivate, BigInteger modulus, BigInteger exponent, boolean isInternal) -
Method Summary
Modifier and TypeMethodDescriptionvoiddestroy()Destroy this object, dropping its reference to the exponent.booleanstatic BigIntegervalidateModulus(BigInteger modulus) Methods inherited from class AsymmetricKeyParameter
isPrivate
-
Constructor Details
-
RSAKeyParameters
-
RSAKeyParameters
public RSAKeyParameters(boolean isPrivate, BigInteger modulus, BigInteger exponent, boolean isInternal)
-
-
Method Details
-
validateModulus
-
getModulus
-
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 interfaceDestroyable
-
isDestroyed
public boolean isDestroyed()- Specified by:
isDestroyedin interfaceDestroyable
-