Class RSAKeyParameters

    • 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)  
    • Constructor Detail

      • RSAKeyParameters

        public RSAKeyParameters​(boolean isPrivate,
                                java.math.BigInteger modulus,
                                java.math.BigInteger exponent)
      • RSAKeyParameters

        public RSAKeyParameters​(boolean isPrivate,
                                java.math.BigInteger modulus,
                                java.math.BigInteger exponent,
                                boolean isInternal)
    • 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 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 javax.security.auth.Destroyable
      • isDestroyed

        public boolean isDestroyed()
        Specified by:
        isDestroyed in interface javax.security.auth.Destroyable