Class AlgorithmBuilder

java.lang.Object
org.opencastproject.security.jwt.AlgorithmBuilder

public final class AlgorithmBuilder extends Object
Helper class to build Algorithm objects.
  • Field Details

  • Method Details

    • buildAlgorithm

      public static com.auth0.jwt.algorithms.Algorithm buildAlgorithm(com.auth0.jwk.Jwk jwk) throws com.auth0.jwk.JwkException
      Build algorithm object from a JSON Web Key.
      Parameters:
      jwk - The JSON Web Key.
      Returns:
      The corresponding algorithm.
      Throws:
      com.auth0.jwk.JwkException - If the algorithm cannot be constructed.
    • buildAlgorithm

      public static com.auth0.jwt.algorithms.Algorithm buildAlgorithm(String alg, PublicKey publicKey)
      Build algorithm object from the 'alg' claim of a JWT and a public key.
      Parameters:
      alg - The 'alg' claim.
      publicKey - The public key.
      Returns:
      The corresponding algorithm.
    • buildAlgorithm

      public static com.auth0.jwt.algorithms.Algorithm buildAlgorithm(com.auth0.jwt.interfaces.DecodedJWT jwt, String secret)
      Build algorithm object from a decoded JWT and a secret.
      Parameters:
      jwt - The decoded JWT.
      secret - The secret.
      Returns:
      The corresponding algorithm.
    • buildAlgorithm

      public static com.auth0.jwt.algorithms.Algorithm buildAlgorithm(String alg, String secret)
      Build algorithm object from the 'alg' claim of a JWT and a secret.
      Parameters:
      alg - The 'alg' claim.
      secret - The secret.
      Returns:
      The corresponding algorithm.