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.EncryptionGets 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, waitMethods inherited from interface edu.iu.crypt.WebEncryption.Builder
encrypt, encrypt
-
Constructor Details
-
JweBuilder
Constructor.- Parameters:
encryption-content encryption algorithmdeflate- true to compress content; false to encrypt without compression
-
-
Method Details
-
compact
Description copied from interface:WebEncryption.BuilderProtects all header parameters except jwk and verifies inputs are valid for JWE compact serialization.- Specified by:
compactin interfaceWebEncryption.Builder- Returns:
- this
-
aad
Description copied from interface:WebEncryption.BuilderProvides additional authentication data for protecting the encrypted content.- Specified by:
aadin interfaceWebEncryption.Builder- Parameters:
additionalData- additional authentication data- Returns:
- this
-
protect
Description copied from interface:WebEncryption.BuilderDefines standard protected header parameters.- Specified by:
protectin interfaceWebEncryption.Builder- Parameters:
params- protected header parameters- Returns:
- this
-
protect
Description copied from interface:WebEncryption.BuilderDefines extended protected header parameters.- Specified by:
protectin interfaceWebEncryption.Builder- Parameters:
params- protected header parameter names- Returns:
- this
-
addRecipient
Description copied from interface:WebEncryption.BuilderAdds a new recipient.- Specified by:
addRecipientin interfaceWebEncryption.Builder- Parameters:
algorithm- key encryption algorithm- Returns:
WebEncryptionRecipient.Builder
-
encrypt
Description copied from interface:WebEncryption.BuilderEncrypts data for sending to all recipients.- Specified by:
encryptin interfaceWebEncryption.Builder- Parameters:
in- stream of data to encrypt- Returns:
- encrypted message
-
encryption
WebEncryption.Encryption encryption()Gets the encryption.- Returns:
- encryption
-