Class HmacMD5KeyGeneratorHybrid

java.lang.Object
javax.crypto.KeyGeneratorSpi
com.ibm.crypto.ibmjcehybrid.provider.HmacMD5KeyGeneratorHybrid

public final class HmacMD5KeyGeneratorHybrid extends KeyGeneratorSpi
This class is a facade for the HmacMD5 Key Generation algorithm.
  • Constructor Details

    • HmacMD5KeyGeneratorHybrid

      public HmacMD5KeyGeneratorHybrid()
      Creates a new instance of the HmacMD5KeyGeneratorHybrid class.
  • 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()
      Gets the key generator and generates the key.
      Specified by:
      engineGenerateKey in class KeyGeneratorSpi
      Returns:
      the new key
    • generateKey

      protected SecretKey generateKey(boolean isExternalCall)
      Gets the key generator and generates the key.
      Parameters:
      isExternalCall - should be true if this method is being called from engineGenerateKey(), otherwise it should be false.
      Returns:
      the new key
    • getGenerator

      protected void getGenerator()
      Creates an instance of the KeyGenerator.
      Throws:
      RuntimeException - if this method fails to create and to initialize the message digest.
    • getBestInstance

      public KeyGenerator getBestInstance(String algorithm)
      Creates an instance of the specified KeyGenerator, the provider will be the selecting the first provider in the list for the generator that returns a KeyGenerator object.
      Parameters:
      algorithm - The desired algorithm
      Returns:
      the requested KeyGenerator
      Throws:
      RuntimeException - if this constructor fails to authenticate the JCE framework.