Class JwtFactories
java.lang.Object
org.forgerock.opendj.rest2ldap.authz.JwtFactories
Factory class for various Jwt classes.
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic final class
ASecretsProvider
whose clock is accessible.static final class
A class used to verify whether a givenSignedJwt
is valid.static final class
A factory class to generateSignedJwt
. -
Field Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic JwtFactories.JwtVerifier
newJwtVerifier
(JwtFactories.JwtSecretsProvider secretsProvider) Returns a new SignedJwtVerifier.static <T extends Secret>
JwtFactories.JwtSecretsProvidernewSecretsProvider
(Clock clock, SecretStore<? super T> secretStore, Purpose<? extends T>... purposes) Returns a newJwtFactories.JwtSecretsProvider
.newSignedJwtFactory
(JwtFactories.JwtSecretsProvider secretsProvider, org.forgerock.json.jose.jws.JwsAlgorithm algorithm, Duration validityPeriodInSecs) Returns a new SignedJwtFactory.
-
Field Details
-
JWT_CLOCK
A common clock to use for signing and validating JWTs.
-
-
Method Details
-
newSecretsProvider
@SafeVarargs public static <T extends Secret> JwtFactories.JwtSecretsProvider newSecretsProvider(Clock clock, SecretStore<? super T> secretStore, Purpose<? extends T>... purposes) Returns a newJwtFactories.JwtSecretsProvider
.- Type Parameters:
T
- The type ofSecret
s supported by theSecretStore
.- Parameters:
clock
- The clock the secrets provider should use.secretStore
- TheSecretStore
used to build the secrets of this secrets provider.purposes
- The purposes associated to the given secret store.- Returns:
- a new JwtSecretsProvider
-
newSignedJwtFactory
public static JwtFactories.SignedJwtFactory newSignedJwtFactory(JwtFactories.JwtSecretsProvider secretsProvider, org.forgerock.json.jose.jws.JwsAlgorithm algorithm, Duration validityPeriodInSecs) Returns a new SignedJwtFactory.- Parameters:
secretsProvider
- The secrets provider used to produce the signed JWTs.algorithm
- TheJwsAlgorithm
used to sign the JWTs.validityPeriodInSecs
- The validity period of the produced JWTs in seconds.- Returns:
- A new SignedJwtFactory.
-
newJwtVerifier
public static JwtFactories.JwtVerifier newJwtVerifier(JwtFactories.JwtSecretsProvider secretsProvider) Returns a new SignedJwtVerifier.- Parameters:
secretsProvider
- The secrets provider used to validate the signed JWTs.- Returns:
- A new SignedJwtFactory.
-