Module ibm.crypto.ibmjcehybrid
Class DiffieHellmanKeyPairGeneratorHybrid
java.lang.Object
java.security.KeyPairGeneratorSpi
java.security.KeyPairGenerator
com.ibm.crypto.ibmjcehybrid.provider.DiffieHellmanKeyPairGeneratorHybrid
This 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
FieldsModifier and TypeFieldDescriptionprotected static com.ibm.misc.DebugThe debug object, null if not instantiated at JVM startup. -
Constructor Summary
ConstructorsConstructorDescriptionCreates a new instance of the DiffieHellmanKeyPairGeneratorHybrid class. -
Method Summary
Modifier and TypeMethodDescriptionGenerates an RSA key pair.protected voidCreates an instance of the KeyPairGenerator.voidinitialize(int strength, SecureRandom random) Initializes this KeyPairGenerator for given modulus size and secure random source.voidinitialize(AlgorithmParameterSpec params, SecureRandom random) Initializes this KeyPairGenerator for given parameters and secure random source.Methods inherited from class java.security.KeyPairGenerator
genKeyPair, getAlgorithm, getInstance, getInstance, getInstance, getProvider, initialize, initialize
-
Field Details
-
debug
protected static com.ibm.misc.Debug debugThe debug object, null if not instantiated at JVM startup.
-
-
Constructor Details
-
DiffieHellmanKeyPairGeneratorHybrid
public DiffieHellmanKeyPairGeneratorHybrid()Creates a new instance of the DiffieHellmanKeyPairGeneratorHybrid class.
-
-
Method Details
-
initialize
public void initialize(AlgorithmParameterSpec params, SecureRandom random) throws InvalidAlgorithmParameterException, InvalidParameterException Initializes this KeyPairGenerator for given parameters and secure random source.- Overrides:
initializein classKeyPairGenerator- Parameters:
params- the RSAKeyParameterSpec for this object.random- the SecureRandom object for generating random numbers.- Throws:
InvalidAlgorithmParameterException- thrown when parameter set is not recognized.InvalidParameterException
-
initialize
Initializes 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 classKeyPairGenerator- Parameters:
strength- the length of the key to be generated.random- the SecureRandom object for generating a random number.- Throws:
InvalidParameterException- thrown when a parameter is not recognized.
-
generateKeyPair
Generates an RSA key pair.- Overrides:
generateKeyPairin classKeyPairGenerator- Returns:
- a KeyPair contains a pair of generated RSA keys
- Throws:
IllegalArgumentException- in the key label formal is not valid
-
getGenerator
protected void getGenerator()Creates an instance of the KeyPairGenerator.- Throws:
RuntimeException- if this method fails to create and to initialize the message digest.
-