java.lang.Object
iu.crypt.JweBuilder
- All Implemented Interfaces:
WebEncryption.Builder
Collects inputs for
Jwe
encrypted messages.-
Constructor Summary
ConstructorsConstructorDescriptionJweBuilder
(WebEncryption.Encryption encryption, boolean deflate) Constructor. -
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.encrypt
(InputStream in) Encrypts data for sending to all recipients.(package private) WebEncryption.Encryption
Gets the encryption.protect
(WebCryptoHeader.Param... params) Defines standard protected header parameters.Defines extended protected header parameters.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface edu.iu.crypt.WebEncryption.Builder
encrypt, encrypt
-
Constructor Details
-
JweBuilder
Constructor.- Parameters:
encryption
-content encryption algorithm
deflate
- true to compress content; false to encrypt without compression
-
-
Method Details
-
compact
Description copied from interface:WebEncryption.Builder
Protects all header parameters except jwk and verifies inputs are valid for JWE compact serialization.- Specified by:
compact
in interfaceWebEncryption.Builder
- Returns:
- this
-
aad
Description copied from interface:WebEncryption.Builder
Provides additional authentication data for protecting the encrypted content.- Specified by:
aad
in interfaceWebEncryption.Builder
- Parameters:
additionalData
- additional authentication data- Returns:
- this
-
protect
Description copied from interface:WebEncryption.Builder
Defines standard protected header parameters.- Specified by:
protect
in interfaceWebEncryption.Builder
- Parameters:
params
- protected header parameters- Returns:
- this
-
protect
Description copied from interface:WebEncryption.Builder
Defines extended protected header parameters.- Specified by:
protect
in interfaceWebEncryption.Builder
- Parameters:
params
- protected header parameter names- Returns:
- this
-
addRecipient
Description copied from interface:WebEncryption.Builder
Adds a new recipient.- Specified by:
addRecipient
in interfaceWebEncryption.Builder
- Parameters:
algorithm
- key encryption algorithm- Returns:
WebEncryptionRecipient.Builder
-
encrypt
Description copied from interface:WebEncryption.Builder
Encrypts data for sending to all recipients.- Specified by:
encrypt
in interfaceWebEncryption.Builder
- Parameters:
in
- stream of data to encrypt- Returns:
- encrypted message
-
encryption
WebEncryption.Encryption encryption()Gets the encryption.- Returns:
- encryption
-