Skip to main content
The Deno 2 Release Candidate is here
Learn more
Module

x/hpke/src/cipherSuiteNative.ts>CipherSuiteNative#seal

A Hybrid Public Key Encryption (HPKE) module built on top of Web Cryptography API.
Latest
method CipherSuiteNative.prototype.seal
import { CipherSuiteNative } from "https://deno.land/x/hpke@1.2.9/src/cipherSuiteNative.ts";

Encrypts a message to a recipient.

If the error occurred, throws EncapError | MessageLimitReachedError | SealError | ValidationError.

Parameters

A set of parameters for building a sender encryption context.

pt: ArrayBuffer

A plain text as bytes to be encrypted.

optional
aad: ArrayBuffer = [UNSUPPORTED]

Additional authenticated data as bytes fed by an application.

Returns

A cipher text and an encapsulated key as bytes.