com.ibm.crypto.fips.provider

Class HmacSHA1KeyGenerator

  1. java.lang.Object
  2. extended byjavax.crypto.KeyGeneratorSpi
  3. extended bycom.ibm.crypto.fips.provider.HmacSHA1KeyGenerator
All implemented interfaces:
AlgorithmStatus

  1. public final class HmacSHA1KeyGenerator
  2. extends javax.crypto.KeyGeneratorSpi
  3. implements AlgorithmStatus
This class generates a secret key for use with the HMAC-SHA1 algorithm.
Version:
1.2, 09/10/99
Author:
Jan Luehe

Constructor Summary

Constructor and Description
HmacSHA1KeyGenerator()
Verify the JCE framework in the constructor.

Method Summary

Modifier and Type Method and Description
  1. protected
  2. javax.crypto.SecretKey
engineGenerateKey()
Generates an HMAC-SHA1 key.
  1. protected
  2. 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.
  1. protected
  2. void
engineInit(int keysize,java.security.SecureRandom random)
Initializes this key generator for a certain keysize, using the given source of randomness.
  1. protected
  2. void
engineInit(java.security.SecureRandom random)
Initializes this key generator.
  1. protected
  2. javax.crypto.SecretKey
internalGenerateKey()
Generates an HMAC-SHA1 key.
  1. protected
  2. void
internalInit(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.
  1. protected
  2. void
internalInit(int keysize,java.security.SecureRandom random)
Initializes this key generator for a certain keysize, using the given source of randomness.
  1. protected
  2. void
internalInit(java.security.SecureRandom random)
Initializes this key generator.
  1. boolean
isFipsApproved()
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

HmacSHA1KeyGenerator

  1. public HmacSHA1KeyGenerator()
Verify the JCE framework in the constructor.
Throws:
java.lang.SecurityException - if fails to verify the JCE framework.

Method Detail

isFipsApproved

  1. public boolean isFipsApproved()
Description copied from interface: AlgorithmStatus
Module identifies if the cryptographic operation (algorithm) is FIPS certified
Specified by:
See Also:

engineInit

  1. protected void engineInit(java.security.SecureRandom random)
Initializes this key generator.
Specified by:
engineInit in class javax.crypto.KeyGeneratorSpi
Parameters:
random - the source of randomness for this generator
Throws:
FIPSRuntimeException - if SelfTest.isFipsRunnable returns false.

internalInit

  1. protected void internalInit(java.security.SecureRandom random)
Initializes this key generator.
Parameters:
random - the source of randomness for this generator

engineInit

  1. protected void engineInit(java.security.spec.AlgorithmParameterSpec params,
  2. java.security.SecureRandom random)
  3. throws java.security.InvalidAlgorithmParameterException
Initializes this key generator with the specified parameter set and a user-provided source of randomness.
Specified by:
engineInit in class javax.crypto.KeyGeneratorSpi
Parameters:
params - the key generation parameters
random - the source of randomness for this key generator
Throws:
java.security.InvalidAlgorithmParameterException - if params is inappropriate for this key generator

internalInit

  1. protected void internalInit(java.security.spec.AlgorithmParameterSpec params,
  2. java.security.SecureRandom random)
  3. throws java.security.InvalidAlgorithmParameterException
Initializes this key generator with the specified parameter set and a user-provided source of randomness.
Parameters:
params - the key generation parameters
random - the source of randomness for this key generator
Throws:
java.security.InvalidAlgorithmParameterException - if params is inappropriate for this key generator
FIPSRuntimeException - if SelfTest.isFipsRunnable returns false.

engineInit

  1. protected void engineInit(int keysize,
  2. java.security.SecureRandom random)
Initializes this key generator for a certain keysize, using the given source of randomness.
Specified by:
engineInit in class javax.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

  1. protected void internalInit(int keysize,
  2. 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

  1. protected javax.crypto.SecretKey engineGenerateKey( )
Generates an HMAC-SHA1 key.
Specified by:
engineGenerateKey in class javax.crypto.KeyGeneratorSpi
Returns:
the new HMAC-SHA1 key

internalGenerateKey

  1. protected javax.crypto.SecretKey internalGenerateKey( )
Generates an HMAC-SHA1 key.
Returns:
the new HMAC-SHA1 key