Class RSAKeyParameters

java.lang.Object
org.bouncycastle.crypto.params.AsymmetricKeyParameter
org.bouncycastle.crypto.params.RSAKeyParameters
All Implemented Interfaces:
Destroyable, CipherParameters
Direct Known Subclasses:
RSAPrivateCrtKeyParameters

public class RSAKeyParameters extends AsymmetricKeyParameter implements Destroyable
  • Constructor Details

    • RSAKeyParameters

      public RSAKeyParameters(boolean isPrivate, BigInteger modulus, BigInteger exponent)
    • RSAKeyParameters

      public RSAKeyParameters(boolean isPrivate, BigInteger modulus, BigInteger exponent, boolean isInternal)
  • Method Details

    • validateModulus

      public static BigInteger validateModulus(BigInteger modulus)
    • getModulus

      public BigInteger getModulus()
    • getExponent

      public BigInteger getExponent()
    • destroy

      public void destroy()
      Destroy this object, dropping its reference to the exponent. The (public) modulus is retained.

      As BigInteger is immutable the exponent cannot be zeroized in place; destruction drops the internal reference so the value becomes unreachable (cleared on garbage collection). After destruction getExponent() throws IllegalStateException.

      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:
      destroy in interface Destroyable
    • isDestroyed

      public boolean isDestroyed()
      Specified by:
      isDestroyed in interface Destroyable