UNPKG

cose-kit

Version:

This is an early prototype of a RFC8152 COSE library for node.js.

15 lines (14 loc) 905 B
import { KeyLike } from 'jose'; import { COSEVerifyGetKey } from '../jwks/local.js'; import { ProtectedHeaders, UnprotectedHeaders } from '../headers.js'; import { SignatureBase } from './SignatureBase.js'; export declare class Sign1 extends SignatureBase { readonly payload: Uint8Array; constructor(protectedHeaders: Map<number, unknown> | Uint8Array, unprotectedHeaders: Map<number, unknown>, payload: Uint8Array, signature: Uint8Array); getContentForEncoding(): (Uint8Array | Map<number, unknown> | undefined)[]; encode(): Buffer; private static Signature1; verify(key: KeyLike | Uint8Array | COSEVerifyGetKey, externalAAD?: Uint8Array): Promise<boolean>; verifyX509(roots: string[]): Promise<boolean>; static sign(protectedHeaders: ProtectedHeaders, unprotectedHeaders: UnprotectedHeaders | undefined, payload: Uint8Array, key: KeyLike | Uint8Array): Promise<Sign1>; }