Skip to main content
Module

x/jose/index.ts>GeneralEncrypt

"JSON Web Almost Everything" - JWA, JWS, JWE, JWT, JWK, JWKS for Node.js, Browser, Cloudflare Workers, Deno, Bun, and other Web-interoperable runtimes.
Extremely Popular
Go to Latest
class GeneralEncrypt
import { GeneralEncrypt } from "https://deno.land/x/jose@v4.14.4/index.ts";

The GeneralEncrypt class is used to build and encrypt General JWE objects.

Constructors

new
GeneralEncrypt(plaintext: Uint8Array)

Properties

private
_aad: Uint8Array
private
_plaintext: Uint8Array
private
_protectedHeader: JWEHeaderParameters
private
_recipients: IndividualRecipient[]
private
_unprotectedHeader: JWEHeaderParameters

Methods

addRecipient(key: KeyLike | Uint8Array, options?: CritOption): Recipient

Adds an additional recipient for the General JWE object.

encrypt(options?: DeflateOption): Promise<GeneralJWE>

Encrypts and resolves the value of the General JWE object.

Sets the Additional Authenticated Data on the GeneralEncrypt object.

setProtectedHeader(protectedHeader: JWEHeaderParameters): this

Sets the JWE Protected Header on the GeneralEncrypt object.

setSharedUnprotectedHeader(sharedUnprotectedHeader: JWEHeaderParameters): this

Sets the JWE Shared Unprotected Header on the GeneralEncrypt object.