Class HmacSHA256KeyGenerator

java.lang.Object
javax.crypto.KeyGeneratorSpi
com.ibm.crypto.hdwrCCA.provider.HmacSHA256KeyGenerator

public final class HmacSHA256KeyGenerator extends KeyGeneratorSpi
This class generates a secret key for use with the HMAC-SHA256 algorithm.
  • Constructor Details

    • HmacSHA256KeyGenerator

      public HmacSHA256KeyGenerator()
      Verify the JCE framework.
      Throws:
      SecurityException - if unable to verify the JCE framework.
  • Method Details

    • engineInit

      protected void engineInit(SecureRandom random)
      Initializes this key generator.
      Specified by:
      engineInit in class KeyGeneratorSpi
      Parameters:
      random - the source of randomness for this generator
    • engineInit

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

      protected void engineInit(int keysize, SecureRandom random)
      Initializes this key generator for a certain keysize, using the given source of randomness.
      Specified by:
      engineInit in class 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 SecretKey engineGenerateKey()
      Generates an HMAC-SHA key.
      Specified by:
      engineGenerateKey in class KeyGeneratorSpi
      Returns:
      the new HMAC-SHA key