public static final class Jwks.HASH extends Object
JWK Thumbprints and ensure valid
JWK Thumbprint URIs.
Each algorithm is made available as a (public static final) constant for direct type-safe
reference in application code. For example:
Jwks.Jwks.builder()() // ... etc ... .idFromThumbprint(Jwts.HASH.SHA256) // <--- .build()
or
HashAlgorithm hashAlg = Jwks.HASH.SHA256;JwkThumbprintthumbprint = aJwk.thumbprint(hashAlg); String rfcMandatoryPrefix = "urn:ietf:params:oauth:jwk-thumbprint:" + hashAlg.getId(); assert thumbprint.toURI().toString().startsWith(rfcMandatoryPrefix);
They are also available together as a Registry instance via the get() method.
get()| Modifier and Type | Field and Description |
|---|---|
static HashAlgorithm |
SHA256
|
static HashAlgorithm |
SHA3_256
|
static HashAlgorithm |
SHA3_384
|
static HashAlgorithm |
SHA3_512
|
static HashAlgorithm |
SHA384
|
static HashAlgorithm |
SHA512
|
| Modifier and Type | Method and Description |
|---|---|
static Registry<String,HashAlgorithm> |
get()
Returns a registry of various (but not all)
IANA Hash
Algorithms commonly used to compute
JWK Thumbprints and ensure valid
JWK Thumbprint URIs. |
public static final HashAlgorithm SHA256
id (aka IANA "Hash Name String")
value of sha-256. It is a HashAlgorithm alias for the native
Java JCA SHA-256 MessageDigest algorithm.public static final HashAlgorithm SHA384
id (aka IANA "Hash Name String")
value of sha-384. It is a HashAlgorithm alias for the native
Java JCA SHA-384 MessageDigest algorithm.public static final HashAlgorithm SHA512
id (aka IANA "Hash Name String")
value of sha-512. It is a HashAlgorithm alias for the native
Java JCA SHA-512 MessageDigest algorithm.public static final HashAlgorithm SHA3_256
id (aka IANA "Hash Name String")
value of sha3-256. It is a HashAlgorithm alias for the native
Java JCA SHA3-256 MessageDigest algorithm.
This algorithm requires at least JDK 9 or a compatible JCA Provider (like BouncyCastle) in the runtime classpath.
public static final HashAlgorithm SHA3_384
id (aka IANA "Hash Name String")
value of sha3-384. It is a HashAlgorithm alias for the native
Java JCA SHA3-384 MessageDigest algorithm.
This algorithm requires at least JDK 9 or a compatible JCA Provider (like BouncyCastle) in the runtime classpath.
public static final HashAlgorithm SHA3_512
id (aka IANA "Hash Name String")
value of sha3-512. It is a HashAlgorithm alias for the native
Java JCA SHA3-512 MessageDigest algorithm.
This algorithm requires at least JDK 9 or a compatible JCA Provider (like BouncyCastle) in the runtime classpath.
public static Registry<String,HashAlgorithm> get()
JWK Thumbprints and ensure valid
JWK Thumbprint URIs.JWK Thumbprints and ensure valid
JWK Thumbprint URIs.Copyright © 2014–2023 jsonwebtoken.io. All rights reserved.