T
- the implementing instance for method chainingpublic interface KeyOperationPolicied<T extends KeyOperationPolicied<T>>
KeyOperationPolicy
used to validate JWK instances.Modifier and Type | Method and Description |
---|---|
T |
operationPolicy(KeyOperationPolicy policy)
Sets the key operation policy that determines which
KeyOperation s may be assigned to a
JWK. |
T operationPolicy(KeyOperationPolicy policy) throws IllegalArgumentException
KeyOperation
s may be assigned to a
JWK. Unless overridden by this method, the default RFC-recommended policy is used where:
RFC-standard key operations
are supported.Multiple unrelated key operations SHOULD NOT be specified for a key because of the potential vulnerabilities associated with using the same key with multiple algorithms. Thus, the combinations "sign
" with "verify
", "encrypt
" with "decrypt
", and "wrapKey
" with "unwrapKey
" are permitted, but other combinations SHOULD NOT be used.
If you wish to enable a different policy, perhaps to support additional custom KeyOperation
values,
one can be created by using the Jwks.OP.policy()
builder, or by implementing the
KeyOperationPolicy
interface directly.
policy
- the policy that determines which KeyOperation
s may be assigned to a JWK.IllegalArgumentException
- if policy
is nullCopyright © 2014–2023 jsonwebtoken.io. All rights reserved.