Package net.shibboleth.tool.xmlsectool
Enum DigestChoice
- java.lang.Object
-
- java.lang.Enum<DigestChoice>
-
- net.shibboleth.tool.xmlsectool.DigestChoice
-
- All Implemented Interfaces:
Serializable,Comparable<DigestChoice>
public enum DigestChoice extends Enum<DigestChoice>
The digest method to use in the various signature algorithms.
-
-
Field Summary
Fields Modifier and Type Field Description private StringdigestAlgorithmDigest algorithm.private StringecdsaAlgorithmECDSA signature algorithm.private StringotherNameOther name (with hyphens, etc.) used as an alternative to the enum name.private StringrsaAlgorithmRSA signature algorithm.
-
Constructor Summary
Constructors Modifier Constructor Description privateDigestChoice(String otherNameArg, String digestArg, String rsaArg, String ecdsaArg)Constructor.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static DigestChoicefind(String name)Finds theDigestChoicefor a given digest name.StringgetDigestAlgorithm()Returns the digest algorithm URI for this digest choice.StringgetECDSAAlgorithm()Returns the ECDSA signature algorithm URI for this digest choice.StringgetRSAAlgorithm()Returns the RSA signature algorithm URI for this digest choice.booleanhasName(String name)Indicates whether the enum can be called by the provided name.static DigestChoicevalueOf(String name)Returns the enum constant of this type with the specified name.static DigestChoice[]values()Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
SHA1
public static final DigestChoice SHA1
SHA-1 digest.
-
SHA256
public static final DigestChoice SHA256
SHA-256 digest.
-
SHA384
public static final DigestChoice SHA384
SHA-384 digest.
-
SHA512
public static final DigestChoice SHA512
SHA-512 digest.
-
-
Field Detail
-
otherName
private final String otherName
Other name (with hyphens, etc.) used as an alternative to the enum name.
-
digestAlgorithm
private final String digestAlgorithm
Digest algorithm.
-
rsaAlgorithm
private final String rsaAlgorithm
RSA signature algorithm.
-
ecdsaAlgorithm
private final String ecdsaAlgorithm
ECDSA signature algorithm.
-
-
Method Detail
-
values
public static DigestChoice[] 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 (DigestChoice c : DigestChoice.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static DigestChoice valueOf(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:
IllegalArgumentException- if this enum type has no constant with the specified nameNullPointerException- if the argument is null
-
getDigestAlgorithm
public String getDigestAlgorithm()
Returns the digest algorithm URI for this digest choice.- Returns:
- algorithm URI
-
getRSAAlgorithm
public String getRSAAlgorithm()
Returns the RSA signature algorithm URI for this digest choice.- Returns:
- algorithm URI
-
getECDSAAlgorithm
public String getECDSAAlgorithm()
Returns the ECDSA signature algorithm URI for this digest choice.- Returns:
- algorithm URI
-
hasName
public boolean hasName(String name)
Indicates whether the enum can be called by the provided name. The name is compared ignoring case against the enum name and against the "other" name.- Parameters:
name- name to check against- Returns:
trueif and only if the enum can be called by the provided name
-
find
public static DigestChoice find(String name)
Finds theDigestChoicefor a given digest name.- Parameters:
name- name of the digest to be found- Returns:
DigestChoicerepresented by the name
-
-