← Back to index
class FlattenedEncrypt

The FlattenedEncrypt class is used to build and encrypt Flattened JWE objects.

Constructors

🔗
FlattenedEncrypt()

Properties

🔗
_aad: Uint8Array
🔗
_cek: Uint8Array
🔗
_iv: Uint8Array
🔗
_keyManagementParameters: JWEKeyManagementHeaderParameters
🔗
_plaintext: Uint8Array
🔗
_protectedHeader: JWEHeaderParameters
🔗
_sharedUnprotectedHeader: JWEHeaderParameters
🔗
_unprotectedHeader: JWEHeaderParameters

Methods

🔗
encrypt(key: KeyLike | Uint8Array, options?: EncryptOptions)

Encrypts and resolves the value of the Flattened JWE object.

🔗
setAdditionalAuthenticatedData(aad: Uint8Array)

Sets the Additional Authenticated Data on the FlattenedEncrypt object.

🔗
setContentEncryptionKey(cek: Uint8Array)

Sets a content encryption key to use, by default a random suitable one is generated for the JWE enc" (Encryption Algorithm) Header Parameter.

🔗
setInitializationVector(iv: Uint8Array)

Sets the JWE Initialization Vector to use for content encryption, by default a random suitable one is generated for the JWE enc" (Encryption Algorithm) Header Parameter.

🔗
setKeyManagementParameters(parameters: JWEKeyManagementHeaderParameters)

Sets the JWE Key Management parameters to be used when encrypting. Use of this is method is really only needed for ECDH based algorithms when utilizing the Agreement PartyUInfo or Agreement PartyVInfo parameters. Other parameters will always be randomly generated when needed and missing.

🔗
setProtectedHeader(protectedHeader: JWEHeaderParameters)

Sets the JWE Protected Header on the FlattenedEncrypt object.

🔗
setSharedUnprotectedHeader(sharedUnprotectedHeader: JWEHeaderParameters)

Sets the JWE Shared Unprotected Header on the FlattenedEncrypt object.

🔗
setUnprotectedHeader(unprotectedHeader: JWEHeaderParameters)

Sets the JWE Per-Recipient Unprotected Header on the FlattenedEncrypt object.