【发布时间】:2018-05-18 08:46:32
【问题描述】:
我正在使用 web3 的 javascript 版本并想从 Web3 Secret Storage Definition 文件(旧 wiki:Passphrase protected key store spec )导入私钥。根据the docs有一个解密和加密功能:
keystoreJsonV3 = web3.eth.accounts.encrypt(privateKey, password);
privateKey = web3.eth.accounts.decrypt(keystoreJsonV3, password);
但我收到“未捕获的类型错误:web3.eth.accounts.decrypt 不是函数”。怎么了?是文档错误还是我的 web3.js 版本错误或类似的东西?如何加密/解密密钥库文件。
我从这个来源构建了我的 web3.js 文件
git clone -b develop https://github.com/ethereum/web3.js.git
【问题讨论】:
标签: javascript ethereum web3js