UNPKG

cose-kit

Version:

**DEPRECATED:** Use [@auth0/cose](https://www.npmjs.com/package/@auth0/cose).

20 lines (19 loc) 697 B
import { Encrypt0 } from './Encrypt0.js'; import { Mac0 } from './Mac0.js'; import { Sign } from './Sign.js'; import { Sign1 } from './Sign1.js'; import { Encrypt } from './Encrypt.js'; export type ObjectType<T> = { new (...args: any): T; tag: number; }; /** * * Decode a buffer into a COSE message. * The cbor structure could be tagged or untagged. * * @param cose {Uint8Array} - The buffer containing the Cose message. * @param expectedType {ObjectType<T>} - The expected type of the COSE message. * @returns {T} - The decoded COSE message. */ export declare const decode: <T extends Encrypt0 | Mac0 | Sign | Sign1 | Encrypt>(cose: Uint8Array, expectedType: ObjectType<T>) => T;