Class HashClaim
- java.lang.Object
-
- com.nimbusds.oauth2.sdk.id.Identifier
-
- com.nimbusds.openid.connect.sdk.claims.HashClaim
-
- All Implemented Interfaces:
Serializable
,Comparable<Identifier>
,net.minidev.json.JSONAware
- Direct Known Subclasses:
AccessTokenHash
,CodeHash
,StateHash
public abstract class HashClaim extends Identifier
The base class for SHA-2 based claims.- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from class com.nimbusds.oauth2.sdk.id.Identifier
DEFAULT_BYTE_LENGTH, secureRandom
-
-
Method Summary
All Methods Static Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static String
computeValue(Identifier identifier, com.nimbusds.jose.JWSAlgorithm alg)
Deprecated.UsecomputeValue(Identifier, JWSAlgorithm, Curve)
instead.static String
computeValue(Identifier identifier, com.nimbusds.jose.JWSAlgorithm alg, com.nimbusds.jose.jwk.Curve crv)
Computes the SHA-2 claim value for the specified identifier.static MessageDigest
getMessageDigestInstance(com.nimbusds.jose.JWSAlgorithm alg)
Deprecated.UsegetMessageDigestInstance(JWSAlgorithm, Curve)
instead.static MessageDigest
getMessageDigestInstance(com.nimbusds.jose.JWSAlgorithm alg, com.nimbusds.jose.jwk.Curve crv)
Gets the matching SHA-2 message digest for the specified JSON Web Signature (JWS) algorithm.-
Methods inherited from class com.nimbusds.oauth2.sdk.id.Identifier
compareTo, equals, getValue, hashCode, toJSONString, toString, toStringList
-
-
-
-
Method Detail
-
getMessageDigestInstance
@Deprecated public static MessageDigest getMessageDigestInstance(com.nimbusds.jose.JWSAlgorithm alg)
Deprecated.UsegetMessageDigestInstance(JWSAlgorithm, Curve)
instead.Gets the matching SHA-2 message digest for the specified JSON Web Signature (JWS) algorithm.- Parameters:
alg
- The JWS algorithm. Must not benull
.- Returns:
- The SHA-2 message digest,
null
if the JWS algorithm or its corresponding SHA-2 message digest are not supported.
-
getMessageDigestInstance
public static MessageDigest getMessageDigestInstance(com.nimbusds.jose.JWSAlgorithm alg, com.nimbusds.jose.jwk.Curve crv)
Gets the matching SHA-2 message digest for the specified JSON Web Signature (JWS) algorithm.- Parameters:
alg
- The JWS algorithm. Must not benull
.crv
- The JWK curve used with the JWS algorithm,null
if not applicable.- Returns:
- The SHA-2 message digest,
null
if the JWS algorithm or its corresponding SHA-2 message digest are not supported.
-
computeValue
@Deprecated public static String computeValue(Identifier identifier, com.nimbusds.jose.JWSAlgorithm alg)
Deprecated.UsecomputeValue(Identifier, JWSAlgorithm, Curve)
instead.Computes the SHA-2 claim value for the specified identifier.- Parameters:
identifier
- The identifier, typically an authorisation code or an access token. Must not benull
.alg
- The reference JWS algorithm. Must not benull
.- Returns:
- The matching (truncated to first half) SHA-2 claim value,
or
null
if the JWS algorithm or its corresponding SHA-2 message digest are not supported.
-
computeValue
public static String computeValue(Identifier identifier, com.nimbusds.jose.JWSAlgorithm alg, com.nimbusds.jose.jwk.Curve crv)
Computes the SHA-2 claim value for the specified identifier.- Parameters:
identifier
- The identifier, typically an authorisation code or an access token. Must not benull
.alg
- The reference JWS algorithm. Must not benull
.crv
- The JWK curve used with the JWS algorithm,null
if not applicable.- Returns:
- The matching (truncated to first half) SHA-2 claim value,
or
null
if the JWS algorithm or its corresponding SHA-2 message digest are not supported.
-
-