com.ibm.crypto.hdwrCCA.provider
Class HmacMD5KeyGenerator
- java.lang.Object
-
- javax.crypto.KeyGeneratorSpi
-
- com.ibm.crypto.hdwrCCA.provider.HmacMD5KeyGenerator
-
public final class HmacMD5KeyGenerator extends javax.crypto.KeyGeneratorSpi
This class generates a secret key for use with the HMAC-MD5 algorithm.
-
-
Constructor Summary
Constructors Constructor and Description HmacMD5KeyGenerator()
Verify the JCE framework in the constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description protected javax.crypto.SecretKey
engineGenerateKey()
Generates an HMAC-MD5 key.protected void
engineInit(java.security.spec.AlgorithmParameterSpec params, java.security.SecureRandom random)
Initializes this key generator with the specified parameter set and a user-provided source of randomness.protected void
engineInit(int keysize, java.security.SecureRandom random)
Initializes this key generator for a certain keysize, using the given source of randomness.protected void
engineInit(java.security.SecureRandom random)
Initializes this key generator.
-
-
-
Constructor Detail
-
HmacMD5KeyGenerator
public HmacMD5KeyGenerator()
Verify the JCE framework in the constructor.- Throws:
java.lang.SecurityException
- if fails to verify the JCE framework.
-
-
Method Detail
-
engineInit
protected void engineInit(java.security.SecureRandom random)
Initializes this key generator.- Specified by:
engineInit
in classjavax.crypto.KeyGeneratorSpi
- Parameters:
random
- the source of randomness for this generator
-
engineInit
protected void engineInit(java.security.spec.AlgorithmParameterSpec params, java.security.SecureRandom random) throws java.security.InvalidAlgorithmParameterException
Initializes this key generator with the specified parameter set and a user-provided source of randomness.- Specified by:
engineInit
in classjavax.crypto.KeyGeneratorSpi
- Parameters:
params
- the key generation parametersrandom
- the source of randomness for this key generator- Throws:
java.security.InvalidAlgorithmParameterException
- ifparams
is inappropriate for this key generator
-
engineInit
protected void engineInit(int keysize, java.security.SecureRandom random)
Initializes this key generator for a certain keysize, using the given source of randomness.- Specified by:
engineInit
in classjavax.crypto.KeyGeneratorSpi
- Parameters:
keysize
- the keysize. This is an algorithm-specific metric specified in number of bits.random
- the source of randomness for this key generator
-
engineGenerateKey
protected javax.crypto.SecretKey engineGenerateKey()
Generates an HMAC-MD5 key.- Specified by:
engineGenerateKey
in classjavax.crypto.KeyGeneratorSpi
- Returns:
- the new HMAC-MD5 key
-
-