com.ibm.crypto.fips.provider
Class HmacSHA1KeyGenerator
- java.lang.Object
-
- javax.crypto.KeyGeneratorSpi
-
- com.ibm.crypto.fips.provider.HmacSHA1KeyGenerator
-
public final class HmacSHA1KeyGenerator extends javax.crypto.KeyGeneratorSpiThis class generates a secret key for use with the HMAC-SHA1 algorithm.
-
-
Constructor Summary
Constructors Constructor and Description HmacSHA1KeyGenerator()Verify the JCE framework in the constructor.
-
Method Summary
Methods Modifier and Type Method and Description protected javax.crypto.SecretKeyengineGenerateKey()Generates an HMAC-SHA1 key.protected voidengineInit(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 voidengineInit(int keysize, java.security.SecureRandom random)Initializes this key generator for a certain keysize, using the given source of randomness.protected voidengineInit(java.security.SecureRandom random)Initializes this key generator.protected javax.crypto.SecretKeyinternalGenerateKey()Generates an HMAC-SHA1 key.protected voidinternalInit(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 voidinternalInit(int keysize, java.security.SecureRandom random)Initializes this key generator for a certain keysize, using the given source of randomness.protected voidinternalInit(java.security.SecureRandom random)Initializes this key generator.
-
-
-
Constructor Detail
-
HmacSHA1KeyGenerator
public HmacSHA1KeyGenerator()
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:
engineInitin classjavax.crypto.KeyGeneratorSpi- Parameters:
random- the source of randomness for this generator- Throws:
FIPSRuntimeException- if SelfTest.isFipsRunnable returns false.
-
internalInit
protected void internalInit(java.security.SecureRandom random)
Initializes this key generator.- 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.InvalidAlgorithmParameterExceptionInitializes this key generator with the specified parameter set and a user-provided source of randomness.- Specified by:
engineInitin classjavax.crypto.KeyGeneratorSpi- Parameters:
params- the key generation parametersrandom- the source of randomness for this key generator- Throws:
java.security.InvalidAlgorithmParameterException- ifparamsis inappropriate for this key generator
-
internalInit
protected void internalInit(java.security.spec.AlgorithmParameterSpec params, java.security.SecureRandom random) throws java.security.InvalidAlgorithmParameterExceptionInitializes this key generator with the specified parameter set and a user-provided source of randomness.- Parameters:
params- the key generation parametersrandom- the source of randomness for this key generator- Throws:
java.security.InvalidAlgorithmParameterException- ifparamsis inappropriate for this key generatorFIPSRuntimeException- if SelfTest.isFipsRunnable returns false.
-
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:
engineInitin 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- Throws:
FIPSRuntimeException- if SelfTest.isFipsRunnable returns false.
-
internalInit
protected void internalInit(int keysize, java.security.SecureRandom random)Initializes this key generator for a certain keysize, using the given source of randomness.- 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-SHA1 key.- Specified by:
engineGenerateKeyin classjavax.crypto.KeyGeneratorSpi- Returns:
- the new HMAC-SHA1 key
-
internalGenerateKey
protected javax.crypto.SecretKey internalGenerateKey()
Generates an HMAC-SHA1 key.- Returns:
- the new HMAC-SHA1 key
-
-