Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/faster/vendor/jose/jwe/general/encrypt.ts>GeneralEncrypt

A fast and optimized middleware server with an absurdly small amount of code (300 lines) built on top of native HTTP APIs with no dependencies. It also has a collection of useful middlewares: log file, serve static, CORS, session, rate limit, token, body parsers, redirect, proxy and handle upload. For Deno Deploy and other enviroments!
Latest
class GeneralEncrypt
import { GeneralEncrypt } from "https://deno.land/x/faster@v12.1/vendor/jose/jwe/general/encrypt.ts";

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

This class is exported (as a named export) from the main 'jose' module entry point as well as from its subpath export 'jose/jwe/general/encrypt'.

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(): Promise<GeneralJWE>

Encrypts and resolves the value of the General JWE object.

setAdditionalAuthenticatedData(aad: Uint8Array): this

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.