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

x/hpke/src/interfaces/encryptionContext.ts>EncryptionContext

A Hybrid Public Key Encryption (HPKE) module built on top of Web Cryptography API.
Latest
interface EncryptionContext
implements Exporter
import { type EncryptionContext } from "https://deno.land/x/hpke@1.2.9/src/interfaces/encryptionContext.ts";

The encryption context interface for a recipient and a sender.

Methods

seal(data: ArrayBuffer, aad?: ArrayBuffer): Promise<ArrayBuffer>

Encrypts data.

If the error occurred, throws SealError | MessageLimitReachedError.

open(data: ArrayBuffer, aad?: ArrayBuffer): Promise<ArrayBuffer>

Decrypts data.

If the error occurred, throws OpenError.