UNPKG

@transmute/x25519-key-pair

Version:
33 lines (32 loc) 1.25 kB
import { LdKeyPairInstance } from '@transmute/ld-key-pair'; import { JsonWebKey2020, X25519KeyAgreementKey2019 } from './types'; export declare class X25519KeyPair implements LdKeyPairInstance { id: string; type: string; controller: string; publicKey: Uint8Array; privateKey?: Uint8Array; static fingerprintFromPublicKey(importableType: JsonWebKey2020): Promise<string>; static generate: ({ secureRandom, }: { secureRandom: () => Uint8Array; }) => Promise<X25519KeyPair>; static from: (k: JsonWebKey2020 | X25519KeyAgreementKey2019) => Promise<X25519KeyPair>; static fromFingerprint({ fingerprint }: { fingerprint: string; }): Promise<X25519KeyPair>; constructor(opts: { id: string; type: string; controller: string; publicKey: Uint8Array; privateKey?: Uint8Array; }); fingerprint(): Promise<string>; export(options?: { privateKey?: boolean; type: 'JsonWebKey2020' | 'X25519KeyAgreementKey2019'; }): Promise<JsonWebKey2020 | X25519KeyAgreementKey2019>; deriveSecret({ publicKey, }: { publicKey: JsonWebKey2020 | X25519KeyAgreementKey2019; }): Promise<Uint8Array>; }