Class ThumbprintUtils


  • public final class ThumbprintUtils
    extends java.lang.Object
    Thumbprint utilities.

    See RFC 7638.

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

      Constructors 
      Constructor Description
      ThumbprintUtils()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static Base64URL compute​(JWK jwk)
      Computes the SHA-256 thumbprint for the specified JWK.
      static Base64URL compute​(java.lang.String hashAlg, JWK jwk)
      Computes the thumbprint for the specified JWK.
      static Base64URL compute​(java.lang.String hashAlg, java.util.LinkedHashMap<java.lang.String,​?> params)
      Computes the thumbprint for the specified required JWK parameters.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • ThumbprintUtils

        public ThumbprintUtils()
    • Method Detail

      • 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​(java.lang.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​(java.lang.String hashAlg,
                                        java.util.LinkedHashMap<java.lang.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.