Package com.nimbusds.jose.jwk
Class ThumbprintURI
- java.lang.Object
-
- com.nimbusds.jose.jwk.ThumbprintURI
-
@Immutable public class ThumbprintURI extends 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
-
-
Constructor Summary
Constructors Constructor Description ThumbprintURI(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(Object o)StringgetAlgorithmString()Returns the hash algorithm string.Base64URLgetThumbprint()Returns the underlying thumbprint value.inthashCode()static ThumbprintURIparse(String s)Parses a JWK thumbprint URI from the specified URI string.static ThumbprintURIparse(URI uri)Parses a JWK thumbprint URI from the specified URI.StringtoString()URItoURI()Returns theURIrepresentation.
-
-
-
Field Detail
-
PREFIX
public static final String PREFIX
The URI prefix of JWK thumbprints.- See Also:
- Constant Field Values
-
-
Constructor Detail
-
ThumbprintURI
public ThumbprintURI(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 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.
-
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(URI uri) throws ParseException
Parses a JWK thumbprint URI from the specified URI.- Parameters:
uri- The URI. Must not benull.- Returns:
- The JWK thumbprint URI.
- Throws:
ParseException- If the URI is illegal.
-
parse
public static ThumbprintURI parse(String s) throws 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:
ParseException- If the URI string is illegal.
-
-