Package org.eclipse.cbi.common.security
Enum MessageDigestAlgorithm
- java.lang.Object
-
- java.lang.Enum<MessageDigestAlgorithm>
-
- org.eclipse.cbi.common.security.MessageDigestAlgorithm
-
- All Implemented Interfaces:
java.io.Serializable
,java.lang.Comparable<MessageDigestAlgorithm>
public enum MessageDigestAlgorithm extends java.lang.Enum<MessageDigestAlgorithm>
A enumeration ofMessageDigest
algorithm available in Java 8 as specified in the document " standard names for algorithms".
-
-
Field Summary
Fields Modifier and Type Field Description private java.util.Set<java.lang.String>
aliases
private java.lang.String
standardName
-
Constructor Summary
Constructors Modifier Constructor Description private
MessageDigestAlgorithm(java.lang.String standardName, java.lang.String... alias)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static MessageDigestAlgorithm
fromStandardName(java.lang.String digestAlgorithmName)
java.lang.String
standardName()
Returns the standard name of theMessageDigest
algorithm as specified in the document " standard names for algorithms"static 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
-
DEFAULT
public static final MessageDigestAlgorithm DEFAULT
-
MD2
public static final MessageDigestAlgorithm MD2
-
MD5
public static final MessageDigestAlgorithm MD5
-
SHA_1
public static final MessageDigestAlgorithm SHA_1
-
SHA1
public static final MessageDigestAlgorithm SHA1
Deprecated.You should really consider usingSHA_1
instead except if you really need to be compatible with some old frameworks (e.g., Eclipse Equinox 3.7 / Indigo)For backward compatibility with frameworks only accepting "SHA1-Digest" from Java 6 and before and reject "SHA-1-Digest". See https://bugs.eclipse.org/bugs/show_bug.cgi?id=483881 for details.
-
SHA_224
public static final MessageDigestAlgorithm SHA_224
-
SHA_256
public static final MessageDigestAlgorithm SHA_256
-
SHA_384
public static final MessageDigestAlgorithm SHA_384
-
SHA_512
public static final MessageDigestAlgorithm SHA_512
-
-
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
-
standardName
public java.lang.String standardName()
Returns the standard name of theMessageDigest
algorithm as specified in the document " standard names for algorithms"- Returns:
- the standard name of the algorithm.
-
fromStandardName
public static MessageDigestAlgorithm fromStandardName(java.lang.String digestAlgorithmName)
-
-