com.ibm.crypto.fips.provider

Class RSAKeyPairGenerator

  • java.lang.Object
    • java.security.KeyPairGeneratorSpi
      • com.ibm.crypto.fips.provider.RSAKeyPairGenerator


  • public final class RSAKeyPairGenerator
    extends java.security.KeyPairGeneratorSpi
    This class generates RSA public/private key pairs. Note: There is a very small chance that an ArithmeticException being thrown during generateKeyPair().
    • Method Summary

      Methods 
      Modifier and Type Method and Description
      java.security.KeyPair generateKeyPair() 
      void initialize(java.security.spec.AlgorithmParameterSpec params, java.security.SecureRandom random) 
      void initialize(int strength) 
      void initialize(int strength, java.security.SecureRandom random)
      Initializes this KeyPairGenerator for given modulus and random source
      protected java.security.KeyPair internalGenerateKeyPair() 
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • RSAKeyPairGenerator

        public RSAKeyPairGenerator()
    • Method Detail

      • initialize

        public void initialize(java.security.spec.AlgorithmParameterSpec params,
                      java.security.SecureRandom random)
                        throws java.security.InvalidAlgorithmParameterException
        Overrides:
        initialize in class java.security.KeyPairGeneratorSpi
        Throws:
        java.security.InvalidAlgorithmParameterException
      • initialize

        public void initialize(int strength,
                      java.security.SecureRandom random)
        Initializes this KeyPairGenerator for given modulus and random source
        Specified by:
        initialize in class java.security.KeyPairGeneratorSpi
        Parameters:
        strength - the length of the key to be generated
        random - the SecureRandom object for generating random number
      • initialize

        public void initialize(int strength)
      • generateKeyPair

        public java.security.KeyPair generateKeyPair()
        Specified by:
        generateKeyPair in class java.security.KeyPairGeneratorSpi
        Throws:
        FIPSRuntimeException - if SelfTest.isFipsRunnable returns false.
      • internalGenerateKeyPair

        protected java.security.KeyPair internalGenerateKeyPair()
© Portions Copyright 2003, 2014, 2015, 2016 IBM Corporation. All rights reserved.
© Portions Copyright 2003, 2014 Oracle and/or its affiliates. All rights reserved.