UNPKG

@ldclabs/cose-ts

Version:

Implemented Keys, Algorithms (RFC9053), COSE (RFC9052) and CWT (RFC8392) in TypeScript.

20 lines (19 loc) 840 B
import { CurveFn } from '@noble/curves/abstract/weierstrass'; import { Key, type Signer, Verifier } from './key'; import { RawMap } from './map'; export declare class ECDSAKey extends Key implements Signer, Verifier { static fromBytes(data: Uint8Array): ECDSAKey; static generate<T>(alg: number, kid?: T): ECDSAKey; static fromSecret<T>(secret: Uint8Array, kid?: T): ECDSAKey; static fromPublic<T>(pubkey: Uint8Array, kid?: T): ECDSAKey; constructor(kv?: RawMap); get alg(): number; set alg(alg: number); getSecretKey(): Uint8Array; getPublicKey(): Uint8Array; public(): ECDSAKey; sign(message: Uint8Array): Uint8Array; verify(message: Uint8Array, signature: Uint8Array): boolean; } export declare function getCrv(alg: number): number; export declare function getCurve(alg: number): CurveFn;