UNPKG

dag-jose

Version:

Typescript implementation of the IPLD dag-jose format

30 lines (29 loc) 817 B
export interface JWERecipient { encrypted_key?: string; header?: Record<string, any>; } export interface DagJWE { aad?: string; ciphertext: string; iv: string; protected: string; recipients?: Array<JWERecipient>; tag: string; unprotected?: Record<string, any>; } export interface EncodedRecipient { encrypted_key?: Uint8Array; header?: Record<string, any>; } export interface EncodedJWE { aad?: Uint8Array; ciphertext: Uint8Array; iv: Uint8Array; protected: Uint8Array; recipients?: Array<EncodedRecipient>; tag: Uint8Array; unprotected?: Record<string, any>; } export declare function fromSplit(split: Array<string>): DagJWE; export declare function encode(jwe: DagJWE): EncodedJWE; export declare function decode(encoded: EncodedJWE): DagJWE;