com.ibm.crypto.ibmjcehybrid.provider
Class DiffieHellmanKeyPairGeneratorHybrid
- java.lang.Object
-
- java.security.KeyPairGeneratorSpi
-
- java.security.KeyPairGenerator
-
- com.ibm.crypto.ibmjcehybrid.provider.DiffieHellmanKeyPairGeneratorHybrid
-
public final class DiffieHellmanKeyPairGeneratorHybrid extends java.security.KeyPairGeneratorThis class is a facade for the generator of Diffie-Hellman key pairs.This key pair generator may be initialized in two different ways:
- By providing the size in bits of the prime modulus. This will be used to create a prime modulus and base generator, which will then be used to create the Diffie-Hellman key pair. The default size of the prime modulus is 1024 bits.
- By providing a prime modulus and base generator.
-
-
Field Summary
Fields Modifier and Type Field and Description protected static com.ibm.misc.DebugdebugThe debug object, null if not instantiated at JVM startup.
-
Constructor Summary
Constructors Constructor and Description DiffieHellmanKeyPairGeneratorHybrid()Creates a new instance of the DiffieHellmanKeyPairGeneratorHybrid class.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description java.security.KeyPairgenerateKeyPair()Generates an RSA key pair.protected voidgetGenerator()Creates an instance of the KeyPairGenerator.voidinitialize(java.security.spec.AlgorithmParameterSpec params, java.security.SecureRandom random)Initializes this KeyPairGenerator for given parameters and secure random source.voidinitialize(int strength, java.security.SecureRandom random)Initializes this KeyPairGenerator for given modulus size and secure random source.
-
-
-
Field Detail
-
debug
protected static com.ibm.misc.Debug debug
The debug object, null if not instantiated at JVM startup.
-
-
Constructor Detail
-
DiffieHellmanKeyPairGeneratorHybrid
public DiffieHellmanKeyPairGeneratorHybrid()
Creates a new instance of the DiffieHellmanKeyPairGeneratorHybrid class.
-
-
Method Detail
-
initialize
public void initialize(java.security.spec.AlgorithmParameterSpec params, java.security.SecureRandom random) throws java.security.InvalidAlgorithmParameterException, java.security.InvalidParameterExceptionInitializes this KeyPairGenerator for given parameters and secure random source.- Overrides:
initializein classjava.security.KeyPairGenerator- Parameters:
params- the RSAKeyParameterSpec for this object.random- the SecureRandom object for generating random numbers.- Throws:
java.security.InvalidAlgorithmParameterException- thrown when parameter set is not recognized.java.security.InvalidParameterException
-
initialize
public void initialize(int strength, java.security.SecureRandom random) throws java.security.InvalidParameterExceptionInitializes this KeyPairGenerator for given modulus size and secure random source. The private key will be stored in the CLEAR not the hardware or the PKDS, the private key label will be randomly generated and the key will be used for signing purposes.- Overrides:
initializein classjava.security.KeyPairGenerator- Parameters:
strength- the length of the key to be generated.random- the SecureRandom object for generating a random number.- Throws:
java.security.InvalidParameterException- thrown when a parameter is not recognized.
-
generateKeyPair
public java.security.KeyPair generateKeyPair()
Generates an RSA key pair.- Overrides:
generateKeyPairin classjava.security.KeyPairGenerator- Returns:
- a KeyPair contains a pair of generated RSA keys
- Throws:
java.lang.IllegalArgumentException- in the key label formal is not valid
-
getGenerator
protected void getGenerator()
Creates an instance of the KeyPairGenerator.- Throws:
java.lang.RuntimeException- if this method fails to create and to initialize the message digest.
-
-