UNPKG

@guarani/jose

Version:

Implementation of the RFCs of the JOSE Working Group.

38 lines (37 loc) 1.73 kB
/// <reference types="node" /> import { Dict } from '@guarani/types'; import { OctKey } from '../../../jwk/algorithms/oct/oct.key'; import { JsonWebEncryptionContentEncryptionAlgorithm } from '../enc/jsonwebencryption-contentencryption.algorithm'; import { JsonWebEncryptionKeyWrapAlgorithm } from './jsonwebencryption-keywrap.algorithm'; import { WrappedKey } from './types/wrapped-key'; /** * Implementation of the dir JSON Web Encryption Key Wrap Algorithm. */ declare class DirKeyWrapAlgorithm extends JsonWebEncryptionKeyWrapAlgorithm { /** * Instantiates a new JSON Web Encryption dir Key Wrap Algorithm to Wrap and Unwrap Content Encryption Keys. */ constructor(); /** * Returns an empty Buffer since the Algorithm does not Wrap the provided Content Encryption Key. * * @param enc JSON Web Encryption Content Encryption Algorithm. * @param key JSON Web Key to be used as the Content Encryption Key used to Encrypt the Plaintext. * @returns Empty Buffer as the Wrapped Content Encryption Key. */ wrap(enc: JsonWebEncryptionContentEncryptionAlgorithm, key: OctKey): Promise<WrappedKey<Dict>>; /** * Returns the provided JSON Web Key as the Content Encryption Key. * * @param enc JSON Web Encryption Content Encryption Algorithm. * @param key JSON Web Key used as the Content Encryption Key. * @param ek ~Wrapped Content Encryption Key~. * @returns Provided JSON Web Key as the Content Encryption Key. */ unwrap(enc: JsonWebEncryptionContentEncryptionAlgorithm, key: OctKey, ek: Buffer): Promise<Buffer>; } /** * Direct use of a shared symmetric key as the CEK. */ export declare const dir: DirKeyWrapAlgorithm; export {};