public final class Jwks extends Object
Standard JWK Thumbprint Algorithm References
Standard IANA Hash
Algorithms commonly used to compute JWK Thumbprint
s and ensure valid
JWK Thumbprint URIs
are available via the Jwks.HASH
registry constants to allow for easy code-completion in IDEs. For example, when
typing:
Jwks.HASH
.// press hotkeys to suggest individual hash algorithms or utility methods
builder()
Modifier and Type | Class and Description |
---|---|
static class |
Jwks.CRV
Constants for all standard JWK
crv (Curve) parameter values
defined in the JSON Web Key Elliptic
Curve Registry (including its
Edwards Elliptic Curve additions).
|
static class |
Jwks.HASH
Various (but not all)
IANA Hash
Algorithms commonly used to compute
JWK Thumbprint s and ensure valid
JWK Thumbprint URIs. |
static class |
Jwks.OP
Constants for all standard JWK
key_ops (Key Operations) parameter values
defined in the JSON Web Key Operations
Registry.
|
Modifier and Type | Method and Description |
---|---|
static DynamicJwkBuilder<?,?> |
builder()
Return a new JWK builder instance, allowing for type-safe JWK builder coercion based on a specified key or key pair.
|
static String |
json(PublicJwk<?> publicJwk)
Converts the specified
PublicJwk into JSON. |
static JwkParserBuilder |
parser()
|
static JwkSetBuilder |
set()
Return a new builder used to create
JwkSet s. |
static JwkSetParserBuilder |
setParser()
|
static String |
UNSAFE_JSON(Jwk<?> jwk)
WARNING - UNSAFE OPERATION - RETURN VALUES CONTAIN RAW KEY MATERIAL, DO NOT LOG OR PRINT TO SYSTEM.OUT.
Converts the specified JWK into JSON, including raw key material.
|
public static DynamicJwkBuilder<?,?> builder()
public static JwkParserBuilder parser()
public static JwkSetBuilder set()
JwkSet
s. For example:
JwkSet jwkSet = Jwks.set() //.provider(aJcaProvider) // optional //.operationPolicy(policy) // optional .add(aJwk) // appends a key .add(aCollection) // appends multiple keys //.keys(allJwks) // sets/replaces all keys .build()
JwkSet
spublic static JwkSetParserBuilder setParser()
public static String json(PublicJwk<?> publicJwk)
PublicJwk
into JSON. Because PublicJwk
s do not contain secret or private
key material, they are safe to be printed to application logs or System.out
.publicJwk
- the PublicJwk
to convert to JSONpublic static String UNSAFE_JSON(Jwk<?> jwk)
SecretJwk
or a PrivateJwk
, be very careful with the return value, ensuring it is not
printed to application logs or system.out.jwk
- the JWK to convert to JSONCopyright © 2014–2023 jsonwebtoken.io. All rights reserved.