UNPKG

@simbachain/cose-ts-secp256k1

Version:

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

20 lines (19 loc) 868 B
import { CurveFn } from '@noble/curves/abstract/weierstrass'; import { RawMap } from './map'; import { Key, type Signer, Verifier } from './key'; 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, alg?: number): ECDSAKey; static fromPublic<T>(pubkey: Uint8Array, kid?: T, alg?: number): 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;