Class CodeHash
- java.lang.Object
-
- com.nimbusds.oauth2.sdk.id.Identifier
-
- com.nimbusds.openid.connect.sdk.claims.HashClaim
-
- com.nimbusds.openid.connect.sdk.claims.CodeHash
-
- All Implemented Interfaces:
Serializable
,Comparable<Identifier>
,net.minidev.json.JSONAware
@Immutable public final class CodeHash extends HashClaim
Authorisation code hash (c_hash
).Related specifications:
- OpenID Connect Core 1.0, section 3.3.2.11.
- 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 Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static CodeHash
compute(AuthorizationCode code, com.nimbusds.jose.JWSAlgorithm alg)
Deprecated.Usecompute(AuthorizationCode, JWSAlgorithm, Curve)
instead.static CodeHash
compute(AuthorizationCode code, com.nimbusds.jose.JWSAlgorithm alg, com.nimbusds.jose.jwk.Curve crv)
Computes the hash for the specified authorisation code and reference JSON Web Signature (JWS) algorithm.boolean
equals(Object object)
static boolean
isRequiredInIDTokenClaims(ResponseType responseType)
Checks if an authorisation code hash claim must be included in ID tokens for the specified response type.-
Methods inherited from class com.nimbusds.openid.connect.sdk.claims.HashClaim
computeValue, computeValue, getMessageDigestInstance, getMessageDigestInstance
-
Methods inherited from class com.nimbusds.oauth2.sdk.id.Identifier
compareTo, getValue, hashCode, toJSONString, toString, toStringList
-
-
-
-
Method Detail
-
isRequiredInIDTokenClaims
public static boolean isRequiredInIDTokenClaims(ResponseType responseType)
Checks if an authorisation code hash claim must be included in ID tokens for the specified response type.- Parameters:
responseType
- The he OpenID Connect response type. Must not benull
.- Returns:
true
if the code hash is required, elsefalse
.
-
compute
@Deprecated public static CodeHash compute(AuthorizationCode code, com.nimbusds.jose.JWSAlgorithm alg)
Deprecated.Usecompute(AuthorizationCode, JWSAlgorithm, Curve)
instead.Computes the hash for the specified authorisation code and reference JSON Web Signature (JWS) algorithm.- Parameters:
code
- The authorisation code. Must not benull
.alg
- The reference JWS algorithm. Must not benull
.- Returns:
- The authorisation code hash, or
null
if the JWS algorithm is not supported.
-
compute
public static CodeHash compute(AuthorizationCode code, com.nimbusds.jose.JWSAlgorithm alg, com.nimbusds.jose.jwk.Curve crv)
Computes the hash for the specified authorisation code and reference JSON Web Signature (JWS) algorithm.- Parameters:
code
- The authorisation code. 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 authorisation code hash, or
null
if the JWS algorithm is not supported.
-
equals
public boolean equals(Object object)
- Overrides:
equals
in classIdentifier
-
-