|
1 |
| -declare class Key { |
2 |
| - static getActiveKey(datadir?: string, keyfile?: string, fs?: any): Promise<any>; |
3 |
| - static getDefault(datadir?: string, keyfile?: string): Promise<any>; |
4 |
| - static getActivePub(datadir?: string, keyfile?: string): Promise<any>; |
5 |
| - static setActiveKey(key: any, save: boolean | undefined, datadir: string | undefined, keyfile: string | undefined, fs: any): void; |
6 |
| - static toString(key: any): string; |
7 |
| - static getId(key: any): any; |
8 |
| - static fromString(str: string): any; |
9 |
| - static generate(): Promise<{ |
| 1 | +/// <reference types="node" /> |
| 2 | +declare const _default: { |
| 3 | + getActiveKey(datadir?: string, keyfile?: string, fs?: any): Promise<any>; |
| 4 | + getDefault(datadir?: string, keyfile?: string): Promise<any>; |
| 5 | + getActivePub(datadir?: string, keyfile?: string): Promise<any>; |
| 6 | + setActiveKey(key: any, save: boolean | undefined, datadir: string | undefined, keyfile: string | undefined, fs: any): void; |
| 7 | + toString(key: any): string; |
| 8 | + getId(key: any): any; |
| 9 | + fromString(str: string): any; |
| 10 | + generate(): Promise<{ |
10 | 11 | pub: any;
|
11 | 12 | priv: any;
|
12 | 13 | epub: any;
|
13 | 14 | epriv: any;
|
14 | 15 | } | undefined>;
|
15 |
| - private static keyToJwk; |
16 |
| - static sign(data: any, pair: any, cb?: Function, opt?: any): Promise<any>; |
17 |
| - static verify(data: any, pair: any, cb?: Function, opt?: any): Promise<any>; |
18 |
| - static secret(_pub: any, _pair: any): Promise<string>; |
19 |
| - static encrypt(_data: any, _pair: any, _cb?: Function, _opt?: {}): Promise<string>; |
20 |
| - static decrypt(_data: any, _pair: any, _cb?: Function, _opt?: {}): Promise<string>; |
21 |
| -} |
22 |
| -export default Key; |
| 16 | + keyToJwk(key: any): JsonWebKey; |
| 17 | + sign(data: any, pair: any, cb?: Function | undefined, opt?: any): Promise<any>; |
| 18 | + verify(data: any, pair: any, cb?: Function | undefined, opt?: any): Promise<any>; |
| 19 | + secret(key: any, pair: any): Promise<string | undefined>; |
| 20 | + aeskey(key: any, salt?: Buffer | undefined): Promise<CryptoKey>; |
| 21 | + random(len: number): Buffer; |
| 22 | + encrypt(data: any, pair: any, cb?: Function | undefined, opt?: any): Promise<any>; |
| 23 | + decrypt(data: any, pair: any, cb?: Function | undefined, opt?: any): Promise<string>; |
| 24 | +}; |
| 25 | +export default _default; |
0 commit comments