- java.lang.Object
-
- java.lang.Enum<MessageDigestAlgorithm>
-
- io.github.astrapi69.crypt.api.algorithm.MessageDigestAlgorithm
-
- All Implemented Interfaces:
Algorithm
,java.io.Serializable
,java.lang.Comparable<MessageDigestAlgorithm>
public enum MessageDigestAlgorithm extends java.lang.Enum<MessageDigestAlgorithm> implements Algorithm
The enumMessageDigestAlgorithm
provides all the algorithm names that can be specified when generating an instance ofMessageDigest
. For more info see: https://docs.oracle.com/en/java/javase/11/docs/specs/security/standard-names.html#messagedigest-algorithms
-
-
Enum Constant Summary
Enum Constants Enum Constant Description MD2
The enum constant for MD2 algorithmMD5
The enum constant for MD5 algorithmSHA_1
The enum constant for SHA-1 algorithmSHA_256
The enum constant for SHA-256 algorithmSHA_384
The enum constant for SHA-384 algorithmSHA_512_224
The enum constant for SHA-512/224 algorithmSHA_512_256
The enum constant for SHA-512/256 algorithmSHA3_224
The enum constant for SHA3-224 algorithmSHA3_256
The enum constant for SHA3-256 algorithmSHA3_384
The enum constant for SHA3-384 algorithmSHA3_512
The enum constant for SHA3-512 algorithmUNKNOWN
The enum constant 'UNKNOWN' if the MessageDigest algorithm is unknown
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
SHA3_224_ALGORITHM_NAME
The string constant SHA3_224_ALGORITHM_NAMEstatic java.lang.String
SHA3_256_ALGORITHM_NAME
The string constant SHA3_256_ALGORITHM_NAMEstatic java.lang.String
SHA3_384_ALGORITHM_NAME
The string constant SHA3_384_ALGORITHM_NAMEstatic java.lang.String
SHA3_512_ALGORITHM_NAME
The string constant SHA3_512_ALGORITHM_NAME-
Fields inherited from interface io.github.astrapi69.crypt.api.algorithm.Algorithm
UNKNOWN_ALGORITHM_NAME
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String
getAlgorithm()
Gets the algorithm for encryption or decryptionstatic MessageDigestAlgorithm
valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name.static MessageDigestAlgorithm[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
MD2
public static final MessageDigestAlgorithm MD2
The enum constant for MD2 algorithm
-
MD5
public static final MessageDigestAlgorithm MD5
The enum constant for MD5 algorithm
-
SHA_1
public static final MessageDigestAlgorithm SHA_1
The enum constant for SHA-1 algorithm
-
SHA_256
public static final MessageDigestAlgorithm SHA_256
The enum constant for SHA-256 algorithm
-
SHA_384
public static final MessageDigestAlgorithm SHA_384
The enum constant for SHA-384 algorithm
-
SHA_512_224
public static final MessageDigestAlgorithm SHA_512_224
The enum constant for SHA-512/224 algorithm
-
SHA_512_256
public static final MessageDigestAlgorithm SHA_512_256
The enum constant for SHA-512/256 algorithm
-
SHA3_224
public static final MessageDigestAlgorithm SHA3_224
The enum constant for SHA3-224 algorithm
-
SHA3_256
public static final MessageDigestAlgorithm SHA3_256
The enum constant for SHA3-256 algorithm
-
SHA3_384
public static final MessageDigestAlgorithm SHA3_384
The enum constant for SHA3-384 algorithm
-
SHA3_512
public static final MessageDigestAlgorithm SHA3_512
The enum constant for SHA3-512 algorithm
-
UNKNOWN
public static final MessageDigestAlgorithm UNKNOWN
The enum constant 'UNKNOWN' if the MessageDigest algorithm is unknown
-
-
Field Detail
-
SHA3_224_ALGORITHM_NAME
public static final java.lang.String SHA3_224_ALGORITHM_NAME
The string constant SHA3_224_ALGORITHM_NAME- See Also:
- Constant Field Values
-
SHA3_256_ALGORITHM_NAME
public static final java.lang.String SHA3_256_ALGORITHM_NAME
The string constant SHA3_256_ALGORITHM_NAME- See Also:
- Constant Field Values
-
SHA3_384_ALGORITHM_NAME
public static final java.lang.String SHA3_384_ALGORITHM_NAME
The string constant SHA3_384_ALGORITHM_NAME- See Also:
- Constant Field Values
-
SHA3_512_ALGORITHM_NAME
public static final java.lang.String SHA3_512_ALGORITHM_NAME
The string constant SHA3_512_ALGORITHM_NAME- See Also:
- Constant Field Values
-
-
Method Detail
-
values
public static MessageDigestAlgorithm[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (MessageDigestAlgorithm c : MessageDigestAlgorithm.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static MessageDigestAlgorithm valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (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:
java.lang.IllegalArgumentException
- if this enum type has no constant with the specified namejava.lang.NullPointerException
- if the argument is null
-
getAlgorithm
public java.lang.String getAlgorithm()
Gets the algorithm for encryption or decryption- Specified by:
getAlgorithm
in interfaceAlgorithm
- Returns:
- the algorithm
-
-