UNPKG

@transmute/bls12381-key-pair

Version:
36 lines (35 loc) 1.33 kB
import { JsonWebKey2020, Bls12381G2Key2020 } from './types'; import { LdKeyPairInstance } from '@transmute/ld-key-pair'; export declare class Bls12381G2KeyPair implements LdKeyPairInstance { id: string; type: string; controller: string; publicKey: Uint8Array; privateKey?: Uint8Array; static fingerprintFromPublicKey(importableType: JsonWebKey2020 | Bls12381G2Key2020): Promise<string>; static generate: ({ secureRandom, }: { secureRandom: () => Uint8Array; }) => Promise<Bls12381G2KeyPair>; static from: (k: JsonWebKey2020 | Bls12381G2Key2020) => Promise<Bls12381G2KeyPair>; static fromFingerprint({ fingerprint }: { fingerprint: string; }): Promise<Bls12381G2KeyPair>; constructor(opts: { id: string; type: string; controller: string; publicKey: Uint8Array; privateKey?: Uint8Array; }); fingerprint(): Promise<string>; export(options?: { privateKey?: boolean; type: 'JsonWebKey2020' | 'Bls12381G2Key2020'; }): Promise<JsonWebKey2020 | Bls12381G2Key2020>; signer(type?: 'BbsUsingG2'): { sign({ data }: any): Promise<Uint8Array>; }; verifier(type?: 'BbsUsingG2'): { verify({ data, signature }: any): Promise<boolean>; }; }