Package com.nimbusds.oauth2.sdk.pkce
Class CodeVerifier
- java.lang.Object
-
- com.nimbusds.oauth2.sdk.auth.Secret
-
- com.nimbusds.oauth2.sdk.pkce.CodeVerifier
-
- All Implemented Interfaces:
Serializable
public class CodeVerifier extends Secret
Authorisation code verifier.Related specifications:
- Proof Key for Code Exchange by OAuth Public Clients (RFC 7636).
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static int
MAX_LENGTH
The maximum character length of a code verifier.static int
MIN_LENGTH
The minimum character length of a code verifier.-
Fields inherited from class com.nimbusds.oauth2.sdk.auth.Secret
DEFAULT_BYTE_LENGTH
-
-
Constructor Summary
Constructors Constructor Description CodeVerifier()
Generates a new code verifier represented by a secure random 256-bit number that is Base64URL-encoded (as a 43 character string, which is theminimum character length
of a code verifier).CodeVerifier(String value)
Creates a new code verifier with the specified value.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(Object object)
Comparison with another secret is constant time, based on the secrets'SHA-256 hashes
.-
Methods inherited from class com.nimbusds.oauth2.sdk.auth.Secret
equalsSHA256Based, erase, expired, getExpirationDate, getSHA256, getValue, getValueBytes, hashCode
-
-
-
-
Field Detail
-
MIN_LENGTH
public static final int MIN_LENGTH
The minimum character length of a code verifier.- See Also:
- Constant Field Values
-
MAX_LENGTH
public static final int MAX_LENGTH
The maximum character length of a code verifier.- See Also:
- Constant Field Values
-
-
Constructor Detail
-
CodeVerifier
public CodeVerifier(String value)
Creates a new code verifier with the specified value.- Parameters:
value
- The code verifier value. Must not contain characters other than [A-Z] / [a-z] / [0-9] / "-" / "." / "_" / "~". The verifier length must be at least 43 characters but not more than 128 characters. Must not benull
or empty string.
-
CodeVerifier
public CodeVerifier()
Generates a new code verifier represented by a secure random 256-bit number that is Base64URL-encoded (as a 43 character string, which is theminimum character length
of a code verifier).
-
-
Method Detail
-
equals
public boolean equals(Object object)
Description copied from class:Secret
Comparison with another secret is constant time, based on the secrets'SHA-256 hashes
.
-
-