@ldclabs/cose-ts
Version:
Implemented Keys, Algorithms (RFC9053), COSE (RFC9052) and CWT (RFC8392) in TypeScript.
20 lines (19 loc) • 861 B
TypeScript
import { CurveFn as XCurveFn } from '@noble/curves/abstract/montgomery';
import { CurveFn } from '@noble/curves/abstract/weierstrass';
import { Key, type ECDHer } from './key';
import { RawMap } from './map';
export declare class ECDHKey extends Key implements ECDHer {
static fromBytes(data: Uint8Array): ECDHKey;
static generate<T>(crv: number, kid?: T): ECDHKey;
static fromSecret<T>(crv: number, secret: Uint8Array, kid?: T): ECDHKey;
static fromPublic<T>(crv: number, pubkey: Uint8Array, kid?: T): ECDHKey;
constructor(kv?: RawMap);
get crv(): number;
set crv(crv: number);
ecdh(remotePublic: Key): Uint8Array;
getSecretKey(): Uint8Array;
getPublicKey(): Uint8Array;
public(): ECDHKey;
}
export declare function getCurve(crv: number): CurveFn | XCurveFn;
export declare function getKeySize(crv: number): number;