Class HmacSHA224KeyGenerator


  • public final class HmacSHA224KeyGenerator
    extends javax.crypto.KeyGeneratorSpi
    This class generates a secret key for use with the HMAC-SHA224 algorithm.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected javax.crypto.SecretKey engineGenerateKey()
      Generates an HMAC-SHA key.
      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.
      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.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • HmacSHA224KeyGenerator

        public HmacSHA224KeyGenerator()
        Verify the JCE framework.
        Throws:
        java.lang.SecurityException - if unable to verify the JCE framework.
    • Method Detail

      • engineInit

        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
      • 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 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
      • 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 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
      • engineGenerateKey

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