K - the type of Java key provided by the JWK.J - the type of asymmetric JWK createdT - the type of the builder, for subtype method chainingpublic interface AsymmetricJwkBuilder<K extends Key,J extends AsymmetricJwk<K>,T extends AsymmetricJwkBuilder<K,J,T>> extends JwkBuilder<K,J,T>, X509Builder<T>
JwkBuilder that builds asymmetric (public or private) JWKs.| Modifier and Type | Method and Description |
|---|---|
T |
publicKeyUse(String use)
Sets the JWK
use (Public Key Use)
parameter value. |
algorithm, id, idFromThumbprint, idFromThumbprint, operationsadd, add, delete, emptyprovider, randomoperationPolicyx509Sha1Thumbprint, x509Sha256Thumbprintx509Chain, x509Sha1Thumbprint, x509Sha256Thumbprint, x509UrlT publicKeyUse(String use) throws IllegalArgumentException
use (Public Key Use)
parameter value. use values are CaSe-SeNsItIvE. A null value will remove the property
from the JWK.
The JWK specification defines the
following use values:
| Value | Key Use |
|---|---|
sig |
signature |
enc |
encryption |
Other values MAY be used. For best interoperability with other applications however, it is recommended to use only the values above.
When a key is used to wrap another key and a public key use designation for the first key is desired, the
enc (encryption) key use value is used, since key wrapping is a kind of encryption. The
enc value is also to be used for public keys used for key agreement operations.
Public Key Use vs Key Operations
Per
JWK RFC 7517, Section 4.3, last paragraph,
the use (Public Key Use) and key_ops (Key Operations) members
SHOULD NOT be used together; however, if both are used, the information they convey MUST be
consistent. Applications should specify which of these members they use, if either is to be used by the
application.
use - the JWK use value.IllegalArgumentException - if the use value is null or empty.Copyright © 2014–2023 jsonwebtoken.io. All rights reserved.