Class JwtFactories

java.lang.Object
org.forgerock.opendj.rest2ldap.authz.JwtFactories

public final class JwtFactories extends Object
Factory class for various Jwt classes.
  • Field Details

    • JWT_CLOCK

      public static final Clock 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)
      Type Parameters:
      T - The type of Secrets supported by the SecretStore.
      Parameters:
      clock - The clock the secrets provider should use.
      secretStore - The SecretStore 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 - The JwsAlgorithm 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.