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
Authorisation code verifier.
Related specifications:
- Proof Key for Code Exchange by OAuth Public Clients (RFC 7636).
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final int
The maximum character length of a code verifier.static final int
The minimum character length of a code verifier.Fields inherited from class com.nimbusds.oauth2.sdk.auth.Secret
DEFAULT_BYTE_LENGTH
-
Constructor Summary
ConstructorsConstructorDescriptionGenerates 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
Modifier and TypeMethodDescriptionboolean
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 Details
-
MIN_LENGTH
The minimum character length of a code verifier.- See Also:
-
MAX_LENGTH
The maximum character length of a code verifier.- See Also:
-
-
Constructor Details
-
CodeVerifier
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 Details
-
equals
Description copied from class:Secret
Comparison with another secret is constant time, based on the secrets'SHA-256 hashes
.
-