public class S256PKCEGenerator extends AbstractPKCEGenerator
Constructor and Description |
---|
S256PKCEGenerator()
Creates a new instance with a default random string generator for new code verifier strings.
|
S256PKCEGenerator(StringGenerator randomStringGenerator)
Creates a new instance with the given random string generator.
|
Modifier and Type | Method and Description |
---|---|
static S256PKCEGenerator |
create()
Creates a new instance with a default random string generator for new code verifier strings.
|
static S256PKCEGenerator |
create(StringGenerator randomStringGenerator)
Creates a new instance with the given random string generator.
|
protected java.lang.String |
createCodeChallenge(java.lang.String codeVerifier)
Returns the derived code challenge string for the given code verifier
by applying the
AbstractPKCEGenerator.getCodeChallengeMethod() . |
protected java.lang.String |
encodeBase64(byte[] hash)
This method is responsible for doing a proper base64 URL encoding of
the given hash value.
|
static S256PKCEGenerator |
instance()
Returns always the same instance of this class.
|
static ProofKeyForCodeExchange |
newProofKey()
Returns a newly generated proof key.
|
generate, generateRandomCodeVerifier, getCodeChallengeMethod, getRandomStringGenerator, toString
public S256PKCEGenerator()
public S256PKCEGenerator(StringGenerator randomStringGenerator)
randomStringGenerator
- A string generator that produces a different string for each invocation (must not be null).
It will be used to generate new code verifier strings.public static S256PKCEGenerator instance()
public static S256PKCEGenerator create()
public static S256PKCEGenerator create(StringGenerator randomStringGenerator)
randomStringGenerator
- A string generator that produces a different string for each invocation (must not be null).
It will be used to generate new code verifier strings.public static ProofKeyForCodeExchange newProofKey()
protected java.lang.String createCodeChallenge(java.lang.String codeVerifier)
AbstractPKCEGenerator
AbstractPKCEGenerator.getCodeChallengeMethod()
.createCodeChallenge
in class AbstractPKCEGenerator
codeVerifier
- The newly created random code verifier.protected java.lang.String encodeBase64(byte[] hash)