Interface JsonJWEBuilder<A,B extends JWEHeaderConfigurator<B>,C extends JsonJWEBuilder<A,B,C>>
- Type Parameters:
A
- the payload typeB
- the JWE JOSE header configurator typeC
- the JSON JWE builder type
- All Superinterfaces:
JsonJOSEObjectBuilder<A,
JsonJWE<A, JsonJWE.BuiltRecipient<A>>, B, C>
A JSON JWE builder is used to build JSON Web Encryption objects that can be serialized to the JSON representation as defined by RFC7516 Section 7.2.
- Since:
- 1.5
- Author:
- Jeremy Kuhn
-
Method Summary
Modifier and TypeMethodDescriptionSpecifies the additional authentication data to use when encrypting the payload.default C
Specifies a recipient to add to the resulting JSON JWE object.Specifies a recipient to add to the resulting JSON JWE object using the specified keys.secureRandom
(SecureRandom secureRandom) Specifies the secure random to use when encrypting the payload.
-
Method Details
-
additionalAuthenticationData
Specifies the additional authentication data to use when encrypting the payload.
- Parameters:
aad
- additional authentication data- Returns:
- this builder
-
secureRandom
Specifies the secure random to use when encrypting the payload.
- Parameters:
secureRandom
- a secure random- Returns:
- this builder
-
recipient
Specifies a recipient to add to the resulting JSON JWE object.
The builder will try to resolve the JWK to use to encrypt the content encryption key based on the JWE JOSE header resulting from the merge of the protected, unprotected and recipient specific headers. It will fail if it wasn't able to find a suitable key.
- Parameters:
headerConfigurer
- the recipient specific JWE JOSE header configurer- Returns:
- this builder
-
recipient
Specifies a recipient to add to the resulting JSON JWE object using the specified keys.
The builder will use the specified keys to encrypt the content encryption key, the first succeeding key will be retained and remaining keys will be ignored. It will fail if no suitable key have been specified or if they are not consistent with the JWE JOSE header resulting from the merge of the protected, unprotected and recipient specific headers.
- Parameters:
headerConfigurer
- the recipient specific JWE JOSE headerkeys
- the keys to consider to encrypt the recipient content encryption key- Returns:
- this builder
-