Class ThumbprintUtils

java.lang.Object
com.nimbusds.jose.jwk.ThumbprintUtils

public final class ThumbprintUtils extends Object
Thumbprint utilities.

See RFC 7638.

Version:
2016-07-26
Author:
Vladimir Dzhuvinov
  • Constructor Details

  • Method Details

    • compute

      public static Base64URL compute(JWK jwk) throws JOSEException
      Computes the SHA-256 thumbprint for the specified JWK.
      Parameters:
      jwk - The JWK. Must not be null.
      Returns:
      The JWK thumbprint.
      Throws:
      JOSEException - If the SHA-256 hash algorithm is not supported.
    • compute

      public static Base64URL compute(String hashAlg, JWK jwk) throws JOSEException
      Computes the thumbprint for the specified JWK.
      Parameters:
      hashAlg - The hash algorithm. Must not be null.
      jwk - The JWK. Must not be null.
      Returns:
      The JWK thumbprint.
      Throws:
      JOSEException - If the hash algorithm is not supported.
    • compute

      public static Base64URL compute(String hashAlg, LinkedHashMap<String,?> params) throws JOSEException
      Computes the thumbprint for the specified required JWK parameters.
      Parameters:
      hashAlg - The hash algorithm. Must not be null.
      params - The required JWK parameters, alphanumerically sorted by parameter name and ready for JSON object serialisation. Must not be null.
      Returns:
      The JWK thumbprint.
      Throws:
      JOSEException - If the hash algorithm is not supported.