- All Known Implementing Classes:
JweBuilder
- Enclosing interface:
WebEncryption
public static interface WebEncryption.Builder
Prepares a new encrypted message.
-
Method Summary
Modifier and TypeMethodDescriptionaad
(byte[] additionalData) Provides additional authentication data for protecting the encrypted content.addRecipient
(WebKey.Algorithm algorithm) Adds a new recipient.compact()
Protects all header parameters except jwk and verifies inputs are valid for JWE compact serialization.default WebEncryption
encrypt
(byte[] data) Encrypts data for sending to all recipients.encrypt
(InputStream in) Encrypts data for sending to all recipients.default WebEncryption
Encrypts data for sending to all recipients.protect
(WebCryptoHeader.Param... params) Defines standard protected header parameters.Defines extended protected header parameters.
-
Method Details
-
compact
WebEncryption.Builder compact()Protects all header parameters except jwk and verifies inputs are valid for JWE compact serialization.- Returns:
- this
-
protect
Defines standard protected header parameters.- Parameters:
params
- protected header parameters- Returns:
- this
-
protect
Defines extended protected header parameters.- Parameters:
params
- protected header parameter names- Returns:
- this
-
aad
Provides additional authentication data for protecting the encrypted content.- Parameters:
additionalData
- additional authentication data- Returns:
- this
-
addRecipient
Adds a new recipient.- Parameters:
algorithm
- key encryption algorithm- Returns:
WebEncryptionRecipient.Builder
-
encrypt
Encrypts data for sending to all recipients.- Parameters:
text
- data to encrypt- Returns:
- encrypted message
-
encrypt
Encrypts data for sending to all recipients.- Parameters:
data
- data to encrypt- Returns:
- encrypted message
-
encrypt
Encrypts data for sending to all recipients.- Parameters:
in
- stream of data to encrypt- Returns:
- encrypted message
-