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.KeyPairGeneratorSpiThis class generates RSA public/private key pairs. Note: There is a very small chance that an ArithmeticException being thrown during generateKeyPair().
-
-
Constructor Summary
Constructors Constructor and Description RSAKeyPairGenerator()
-
Method Summary
Methods Modifier and Type Method and Description java.security.KeyPairgenerateKeyPair()voidinitialize(java.security.spec.AlgorithmParameterSpec params, java.security.SecureRandom random)voidinitialize(int strength)voidinitialize(int strength, java.security.SecureRandom random)Initializes this KeyPairGenerator for given modulus and random sourceprotected java.security.KeyPairinternalGenerateKeyPair()
-
-
-
Method Detail
-
initialize
public void initialize(java.security.spec.AlgorithmParameterSpec params, java.security.SecureRandom random) throws java.security.InvalidAlgorithmParameterException- Overrides:
initializein classjava.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:
initializein classjava.security.KeyPairGeneratorSpi- Parameters:
strength- the length of the key to be generatedrandom- the SecureRandom object for generating random number
-
initialize
public void initialize(int strength)
-
generateKeyPair
public java.security.KeyPair generateKeyPair()
- Specified by:
generateKeyPairin classjava.security.KeyPairGeneratorSpi- Throws:
FIPSRuntimeException- if SelfTest.isFipsRunnable returns false.
-
internalGenerateKeyPair
protected java.security.KeyPair internalGenerateKeyPair()
-
-