import { Header } from './header'; import { type Label } from './map'; import { Key, type Encryptor } from './key'; /** * Encrypt0Message represents a COSE_Encrypt0 object. * * Use this structure when the recipient already knows the content encryption * key. The protected header bytes and optional externalData are authenticated * as AEAD additional data. * * @example * ```ts * const key = AesGcmKey.generate(iana.AlgorithmA128GCM) * const aad = utf8ToBytes('profile:v1') * const cose = await new Encrypt0Message(plaintext).toBytes(key, aad) * const decrypted = await Encrypt0Message.fromBytes(key, cose, aad) * ``` * * Reference https://datatracker.ietf.org/doc/html/rfc9052#name-single-recipient-encrypted. */ export declare class Encrypt0Message { payload: Uint8Array; protected: Header | null; unprotected: Header | null; private static encBytes; static fromBytes(key: Key & Encryptor, coseData: Uint8Array, externalData?: Uint8Array, understoodCriticalLabels?: Iterable