Package com.nimbusds.jose.jwk
Class ThumbprintURI
- java.lang.Object
-
- com.nimbusds.jose.jwk.ThumbprintURI
-
@Immutable public class ThumbprintURI extends java.lang.ObjectJSON 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.StringPREFIXThe URI prefix of JWK thumbprints.
-
Constructor Summary
Constructors Constructor Description ThumbprintURI(java.lang.String hashAlg, Base64URL thumbprint)Creates a new JWK thumbprint URI.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static ThumbprintURIcompute(JWK jwk)Computes the SHA-256 JWK thumbprint URI for the specified JWK.booleanequals(java.lang.Object o)java.lang.StringgetAlgorithmString()Returns the hash algorithm string.Base64URLgetThumbprint()Returns the underlying thumbprint value.inthashCode()static ThumbprintURIparse(java.lang.String s)Parses a JWK thumbprint URI from the specified URI string.static ThumbprintURIparse(java.net.URI uri)Parses a JWK thumbprint URI from the specified URI.java.lang.StringtoString()java.net.URItoURI()Returns theURIrepresentation.
-
-
-
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 benull.thumbprint- The thumbprint value. Must not benull.
-
-
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 theURIrepresentation.- Returns:
- The
URIrepresentation.
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.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 benull.- 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 benull.- 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 benull.- Returns:
- The JWK thumbprint URI.
- Throws:
java.text.ParseException- If the URI string is illegal.
-
-