-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathkeystore.d.ts
44 lines (40 loc) · 931 Bytes
/
keystore.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
interface KeyStoreJSON{
address: string
crypto: {
cipher: string
cipherparams: {
iv: string
},
ciphertext: string
}
kdf: string
kdfparams: {
timeCost: number
memoryCost: number
parallelism: number
salt: string
}
version: string
mac: string
id: string
}
export default class KeyStore{
setArgon2(fn: (pwd: Uint8Array | string, salt: Uint8Array) => Promise<Uint8Array>): void;
/**
* 生成 keystore
* @param pwd 密码
*/
Create (pwd: string) : Promise<KeyStoreJSON>;
/**
* 读取keystore中的私钥
* @param addr keystore 路径
* @param pwd 密码
*/
DecryptSecretKey(addr: string, pwd: string): Promise<any>;
/**
*
* @param keyStore
* @param pwd
*/
DecryptSecretKeyfull(keyStore: KeyStoreJSON, pwd: string): Promise<string>;
}