Package com.nimbusds.oauth2.sdk.pkce
Class CodeChallenge
- java.lang.Object
-
- com.nimbusds.oauth2.sdk.id.Identifier
-
- com.nimbusds.oauth2.sdk.pkce.CodeChallenge
-
- All Implemented Interfaces:
Serializable
,Comparable<Identifier>
,net.minidev.json.JSONAware
public class CodeChallenge extends Identifier
Authorisation code challenge.Related specifications:
- Proof Key for Code Exchange by OAuth Public Clients (RFC 7636).
- 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 Modifier and Type Method Description static CodeChallenge
compute(CodeChallengeMethod method, CodeVerifier codeVerifier)
Computes the code challenge using the specified method and verifier.static CodeChallenge
parse(String value)
Parses a code challenge from the specified string.-
Methods inherited from class com.nimbusds.oauth2.sdk.id.Identifier
compareTo, equals, getValue, hashCode, toJSONString, toString, toStringList
-
-
-
-
Method Detail
-
compute
public static CodeChallenge compute(CodeChallengeMethod method, CodeVerifier codeVerifier)
Computes the code challenge using the specified method and verifier.- Parameters:
method
- The code challenge method. Must be supported and notnull
.codeVerifier
- The code verifier. Must not benull
.- Returns:
- The computed code challenge.
-
parse
public static CodeChallenge parse(String value) throws ParseException
Parses a code challenge from the specified string.- Parameters:
value
- The code challenge value.- Returns:
- The code challenge.
- Throws:
ParseException
- If parsing failed.
-
-