SMESH keystore files are encrypted and cannot be used by CLIWallet.
CLIWallet wallet files are simple JSON files containing only the private and public keys.
This utility extracts all the private/public keypairs from a keystore and writes them to individual JSON files.
smesh2cli -input -password -output
input
e.g.~/.config/spacemesh/my_wallet_0_2020-04-25T19-40-50.942Z.json
password
- your smesh app passwordoutput file base
e.g.smdata/wallet
A keystore file can contains multiple names key pairs. Assuming that you had two, workKey and funKey, they would be saved as two files smdata/wallet0.json
and smdata/wallet1.json
. The conversion process will indicate how they were saved.
https://github.com/ricmoo/aes-js/blob/master/index.js#L613
This explained how to implement the line
const aes1Ctr = new aes.ModeOfOperation.ctr(key, new aes.Counter(5)); // eslint-disable-line new-cap