Class ThumbprintURI


  • @Immutable
    public class ThumbprintURI
    extends java.lang.Object
    JSON Web Key (JWK) thumbprint URI.

    Example SHA-256 thumbprint URI:

     urn:ietf:params:oauth:jwk-thumbprint:sha-256:NzbLsXh8uDCcd-6MNwXF4W_7noWXFZAfHkxZsRGC9Xs
     

    See draft-ietf-oauth-jwk-thumbprint-uri-01

    Version:
    2022-02-21
    Author:
    Vladimir Dzhuvinov
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static java.lang.String PREFIX
      The URI prefix of JWK thumbprints.
    • Constructor Summary

      Constructors 
      Constructor Description
      ThumbprintURI​(java.lang.String hashAlg, Base64URL thumbprint)
      Creates a new JWK thumbprint URI.
    • Field Detail

      • PREFIX

        public static final java.lang.String PREFIX
        The URI prefix of JWK thumbprints.
        See Also:
        Constant Field Values
    • Constructor Detail

      • ThumbprintURI

        public ThumbprintURI​(java.lang.String hashAlg,
                             Base64URL thumbprint)
        Creates a new JWK thumbprint URI.
        Parameters:
        hashAlg - The hash algorithm. Must not be null.
        thumbprint - The thumbprint value. Must not be null.
    • Method Detail

      • getAlgorithmString

        public java.lang.String getAlgorithmString()
        Returns the hash algorithm string.
        Returns:
        The hash algorithm string.
      • getThumbprint

        public Base64URL getThumbprint()
        Returns the underlying thumbprint value.
        Returns:
        The thumbprint value.
      • toURI

        public java.net.URI toURI()
        Returns the URI representation.
        Returns:
        The URI representation.
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • equals

        public boolean equals​(java.lang.Object o)
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • compute

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

        public static ThumbprintURI parse​(java.net.URI uri)
                                   throws java.text.ParseException
        Parses a JWK thumbprint URI from the specified URI.
        Parameters:
        uri - The URI. Must not be null.
        Returns:
        The JWK thumbprint URI.
        Throws:
        java.text.ParseException - If the URI is illegal.
      • parse

        public static ThumbprintURI parse​(java.lang.String s)
                                   throws java.text.ParseException
        Parses a JWK thumbprint URI from the specified URI string.
        Parameters:
        s - The URI string. Must not be null.
        Returns:
        The JWK thumbprint URI.
        Throws:
        java.text.ParseException - If the URI string is illegal.