public interface JwtEncryptionBuilder extends JwtEncryption
JwtEncryptionBuilder implementations must set the 'alg' (algorithm) header to 'RSA-OAEP-256' and 'enc' (content encryption algorithm) header to 'A256GCM' unless they have already been set. The 'cty' (content type) header must be set to 'JWT' when the inner signed JWT is encrypted.
Note that JwtEncryptionBuilder implementations are not expected to be thread-safe. However reusing a single JwtEncryptionBuilder for creating more than one encrypted token is not recommended because a single JwtEncryptionBuilder can not provide a unique token identifier per every token.
| Modifier and Type | Method and Description |
|---|---|
JwtEncryptionBuilder |
contentAlgorithm(ContentEncryptionAlgorithm algorithm)
Set an 'enc' content encryption algorithm.
|
default JwtEncryptionBuilder |
contentEncryptionAlgorithm(ContentEncryptionAlgorithm algorithm)
|
JwtEncryptionBuilder |
header(String name,
Object value)
Custom JWT encryption header.
|
JwtEncryptionBuilder |
keyAlgorithm(KeyEncryptionAlgorithm algorithm)
Set an 'alg' key encryption algorithm.
|
default JwtEncryptionBuilder |
keyEncryptionAlgorithm(KeyEncryptionAlgorithm algorithm)
Deprecated.
|
default JwtEncryptionBuilder |
keyEncryptionKeyId(String keyId)
Deprecated.
|
JwtEncryptionBuilder |
keyId(String keyId)
Set a 'kid' key encryption key id.
|
encrypt, encrypt, encrypt, encrypt, encryptWithSecretJwtEncryptionBuilder keyAlgorithm(KeyEncryptionAlgorithm algorithm)
algorithm - the key encryption algorithm@Deprecated default JwtEncryptionBuilder keyEncryptionAlgorithm(KeyEncryptionAlgorithm algorithm)
keyAlgorithm(io.smallrye.jwt.algorithm.KeyEncryptionAlgorithm)algorithm - the key encryption algorithmJwtEncryptionBuilder contentAlgorithm(ContentEncryptionAlgorithm algorithm)
algorithm - the content encryption algorithm@Deprecated default JwtEncryptionBuilder contentEncryptionAlgorithm(ContentEncryptionAlgorithm algorithm)
algorithm - the content encryption algorithmJwtEncryptionBuilder keyId(String keyId)
keyId - the key id@Deprecated default JwtEncryptionBuilder keyEncryptionKeyId(String keyId)
keyId(java.lang.String)keyId - the key idJwtEncryptionBuilder header(String name, Object value)
KeyEncryptionAlgorithm values.
If the 'enc' (encryption) header is set with this method then it
has to match one of the ContentEncryptionAlgorithm values.name - the header namevalue - the header valueCopyright © 2018–2022. All rights reserved.