Module crypt.api

Enum Class MacAlgorithm

java.lang.Object
java.lang.Enum<MacAlgorithm>
io.github.astrapi69.crypt.api.algorithm.MacAlgorithm
All Implemented Interfaces:
Algorithm, Serializable, Comparable<MacAlgorithm>, Constable

public enum MacAlgorithm extends Enum<MacAlgorithm> implements Algorithm
The enum MacAlgorithm contains the algorithm names that can be specified when requesting an instance of Mac. For more info see: https://docs.oracle.com/javase/8/docs/technotes/guides/security/StandardNames.html#Mac
  • Enum Constant Details

    • HmacMD5

      public static final MacAlgorithm HmacMD5
      The enum constant for HmacMD5 algorithm.
    • HmacSHA1

      public static final MacAlgorithm HmacSHA1
      The enum constant for HmacSHA1 algorithm.
    • HmacSHA224

      public static final MacAlgorithm HmacSHA224
      The enum constant for HmacSHA224 algorithm.
    • HmacSHA256

      public static final MacAlgorithm HmacSHA256
      The enum constant for HmacSHA256 algorithm.
    • HmacSHA384

      public static final MacAlgorithm HmacSHA384
      The enum constant for HmacSHA384 algorithm.
    • HmacSHA512

      public static final MacAlgorithm HmacSHA512
      The enum constant for HmacSHA512 algorithm.
    • H_MAC_SHA512_224

      public static final MacAlgorithm H_MAC_SHA512_224
      The enum constant for HmacSHA512 algorithm.
    • H_MAC_SHA512_256

      public static final MacAlgorithm H_MAC_SHA512_256
      The enum constant for HmacSHA512 algorithm.
    • H_MAC_SHA3_224

      public static final MacAlgorithm H_MAC_SHA3_224
      The enum constant for HmacSHA224 algorithm.
    • H_MAC_SHA3_256

      public static final MacAlgorithm H_MAC_SHA3_256
      The enum constant for HmacSHA256 algorithm.
    • H_MAC_SHA3_384

      public static final MacAlgorithm H_MAC_SHA3_384
      The enum constant for HmacSHA384 algorithm.
    • H_MAC_SHA3_512

      public static final MacAlgorithm H_MAC_SHA3_512
      The enum constant for HmacSHA512 algorithm.
    • PBEWithHmacMD5

      public static final MacAlgorithm PBEWithHmacMD5
      The enum constant for PBEWithHmacMD5 algorithm.
    • PBEWithHmacSHA1

      public static final MacAlgorithm PBEWithHmacSHA1
      The enum constant for PBEWithHmacSHA1 algorithm.
    • PBEWithHmacSHA224

      public static final MacAlgorithm PBEWithHmacSHA224
      The enum constant for PBEWithHmacSHA224 algorithm.
    • PBEWithHmacSHA256

      public static final MacAlgorithm PBEWithHmacSHA256
      The enum constant for PBEWithHmacSHA256 algorithm.
    • PBEWithHmacSHA384

      public static final MacAlgorithm PBEWithHmacSHA384
      The enum constant for PBEWithHmacSHA384 algorithm.
    • PBEWithHmacSHA512

      public static final MacAlgorithm PBEWithHmacSHA512
      The enum constant for PBEWithHmacSHA512 algorithm.
    • UNKNOWN

      public static final MacAlgorithm UNKNOWN
      The enum constant 'UNKNOWN' if the mac algorithm is unknown
  • Field Details

    • HMAC

      public static final String HMAC
      The Constant HMAC.
      See Also:
    • PBE_WITH_HMAC_MD5_ALGORITHM_NAME

      public static final String PBE_WITH_HMAC_MD5_ALGORITHM_NAME
      The string constant PBE_WITH_HMAC_MD5_ALGORITHM_NAME
      See Also:
    • PBE_WITH_HMAC_SHA1_ALGORITHM_NAME

      public static final String PBE_WITH_HMAC_SHA1_ALGORITHM_NAME
      The string constant PBE_WITH_HMAC_SHA1_ALGORITHM_NAME
      See Also:
    • PBE_WITH_HMAC_SHA224_ALGORITHM_NAME

      public static final String PBE_WITH_HMAC_SHA224_ALGORITHM_NAME
      The string constant PBE_WITH_HMAC_SHA224_ALGORITHM_NAME
      See Also:
    • PBE_WITH_HMAC_SHA256_ALGORITHM_NAME

      public static final String PBE_WITH_HMAC_SHA256_ALGORITHM_NAME
      The string constant PBE_WITH_HMAC_SHA256_ALGORITHM_NAME
      See Also:
    • PBE_WITH_HMAC_SHA384_ALGORITHM_NAME

      public static final String PBE_WITH_HMAC_SHA384_ALGORITHM_NAME
      The string constant PBE_WITH_HMAC_SHA384_ALGORITHM_NAME
      See Also:
    • PBE_WITH_HMAC_SHA512_ALGORITHM_NAME

      public static final String PBE_WITH_HMAC_SHA512_ALGORITHM_NAME
      The string constant PBE_WITH_HMAC_SHA512_ALGORITHM_NAME
      See Also:
    • H_MAC_MD5_ALGORITHM_NAME

      public static final String H_MAC_MD5_ALGORITHM_NAME
      The string constant H_MAC_MD5_ALGORITHM_NAME
      See Also:
    • H_MAC_SHA1_ALGORITHM_NAME

      public static final String H_MAC_SHA1_ALGORITHM_NAME
      The string constant H_MAC_SHA1_ALGORITHM_NAME
      See Also:
    • H_MAC_SHA224_ALGORITHM_NAME

      public static final String H_MAC_SHA224_ALGORITHM_NAME
      The string constant H_MAC_SHA224_ALGORITHM_NAME
      See Also:
    • H_MAC_SHA256_ALGORITHM_NAME

      public static final String H_MAC_SHA256_ALGORITHM_NAME
      The string constant H_MAC_SHA256_ALGORITHM_NAME
      See Also:
    • H_MAC_SHA384_ALGORITHM_NAME

      public static final String H_MAC_SHA384_ALGORITHM_NAME
      The string constant H_MAC_SHA384_ALGORITHM_NAME
      See Also:
    • H_MAC_SHA512_ALGORITHM_NAME

      public static final String H_MAC_SHA512_ALGORITHM_NAME
      The string constant H_MAC_SHA512_ALGORITHM_NAME
      See Also:
    • H_MAC_SHA512_224_ALGORITHM_NAME

      public static final String H_MAC_SHA512_224_ALGORITHM_NAME
      The string constant H_MAC_SHA512_ALGORITHM_NAME
      See Also:
    • H_MAC_SHA512_256_ALGORITHM_NAME

      public static final String H_MAC_SHA512_256_ALGORITHM_NAME
      The string constant H_MAC_SHA512_ALGORITHM_NAME
      See Also:
    • H_MAC_SHA3_224_ALGORITHM_NAME

      public static final String H_MAC_SHA3_224_ALGORITHM_NAME
      The string constant H_MAC_SHA3_224_ALGORITHM_NAME
      See Also:
    • H_MAC_SHA3_256_ALGORITHM_NAME

      public static final String H_MAC_SHA3_256_ALGORITHM_NAME
      The string constant H_MAC_SHA3_256_ALGORITHM_NAME
      See Also:
    • H_MAC_SHA3_384_ALGORITHM_NAME

      public static final String H_MAC_SHA3_384_ALGORITHM_NAME
      The string constant H_MAC_SHA3_384_ALGORITHM_NAME
      See Also:
    • H_MAC_SHA3_512_ALGORITHM_NAME

      public static final String H_MAC_SHA3_512_ALGORITHM_NAME
      The string constant H_MAC_SHA3_512_ALGORITHM_NAME
      See Also:
  • Method Details

    • values

      public static MacAlgorithm[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static MacAlgorithm valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null
    • getAlgorithm

      public String getAlgorithm()
      Gets the algorithm for encryption or decryption
      Specified by:
      getAlgorithm in interface Algorithm
      Returns:
      the algorithm