Package org.tomitribe.auth.signatures
Enum SigningAlgorithm
- java.lang.Object
-
- java.lang.Enum<SigningAlgorithm>
-
- org.tomitribe.auth.signatures.SigningAlgorithm
-
- All Implemented Interfaces:
java.io.Serializable,java.lang.Comparable<SigningAlgorithm>
public enum SigningAlgorithm extends java.lang.Enum<SigningAlgorithm>
The algorithm parameter contains the name of the signature's Algorithm, as registered in the HTTP Signature Algorithms Registry defined by this document. The signature verification is based on the signature's algorithm from the keyId parameter rather than from this algorithm. If algorithm is provided and differs from or is incompatible with the algorithm or key material identified by keyId (for example, algorithm has a value of rsa-sha256 but keyId identifies an EdDSA key), then a verification exception is raised. The default value for this parameter should be "hs2019".
-
-
Enum Constant Summary
Enum Constants Enum Constant Description ECDSA_SHA256HMAC_SHA256HS2019The actual cryptographic algorithm is derived from metadata associated with keyId.RSA_SHA1RSA_SHA256
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static SigningAlgorithmget(java.lang.String name)Returns the SigningAlgorithm with the specified name.java.lang.StringgetAlgorithmName()java.util.Set<Algorithm>getSupportedAlgorithms()java.lang.StringtoString()static SigningAlgorithmvalueOf(java.lang.String name)Returns the enum constant of this type with the specified name.static SigningAlgorithm[]values()Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
HS2019
public static final SigningAlgorithm HS2019
The actual cryptographic algorithm is derived from metadata associated with keyId. Recommend support for: RSASSA-PSS [RFC8017] using SHA-512 [RFC6234] HMAC [RFC2104] using SHA-512 [RFC6234] ECDSA using curve P-256 [DSS] and SHA-512 [RFC6234] Ed25519ph, Ed25519ctx, and Ed25519 [RFC8032]
-
RSA_SHA1
public static final SigningAlgorithm RSA_SHA1
-
RSA_SHA256
public static final SigningAlgorithm RSA_SHA256
-
ECDSA_SHA256
public static final SigningAlgorithm ECDSA_SHA256
-
HMAC_SHA256
public static final SigningAlgorithm HMAC_SHA256
-
-
Method Detail
-
values
public static SigningAlgorithm[] 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 (SigningAlgorithm c : SigningAlgorithm.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static SigningAlgorithm 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
-
getAlgorithmName
public java.lang.String getAlgorithmName()
-
getSupportedAlgorithms
public java.util.Set<Algorithm> getSupportedAlgorithms()
-
get
public static SigningAlgorithm get(java.lang.String name)
Returns the SigningAlgorithm with the specified name.- Parameters:
name- the name of the signing algorithm.- Returns:
- the SigningAlgorithm
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Enum<SigningAlgorithm>
-
-