Skip to content
This repository has been archived by the owner on Jul 20, 2024. It is now read-only.

3. Ethereum KeyStore 使用方法

QuincySx edited this page Apr 15, 2018 · 2 revisions

导出 Keystore

EthECKeyPair key = *;
//第一种 手机性能不够可能会 OOM
KeyStoreFile light = KeyStore.createStandard("123456",key);
//第二种 推荐手机使用但是加密强度低(一般手机钱包都是使用此选项)
KeyStoreFile light = KeyStore.createLight("123456",key);
//第三种 推荐参照 createLight 方法自己传入 n、p
KeyStoreFile create(String password, EthECKeyPair ecKeyPair, int n, int p)

String keystore = light.toString();

导入 Keystore

KeyStoreFile keyStoreFile = KeyStoreFile.parse(keystore 字符串);
EthECKeyPair decrypt = KeyStore.decrypt("123456", keyStoreFile);
Clone this wiki locally