diff options
author | zelig <viktor.tron@gmail.com> | 2014-06-30 03:26:55 +0800 |
---|---|---|
committer | zelig <viktor.tron@gmail.com> | 2014-06-30 03:26:55 +0800 |
commit | a8be0d9f4849d8127d2ba36b90327097f94a91cb (patch) | |
tree | 7fec22a1f902fff28172742390c500fa3e19c0f0 /ethcrypto | |
parent | dabaa4cce01586fd8b1b9314073a1d26f35355c8 (diff) | |
download | go-tangerine-a8be0d9f4849d8127d2ba36b90327097f94a91cb.tar go-tangerine-a8be0d9f4849d8127d2ba36b90327097f94a91cb.tar.gz go-tangerine-a8be0d9f4849d8127d2ba36b90327097f94a91cb.tar.bz2 go-tangerine-a8be0d9f4849d8127d2ba36b90327097f94a91cb.tar.lz go-tangerine-a8be0d9f4849d8127d2ba36b90327097f94a91cb.tar.xz go-tangerine-a8be0d9f4849d8127d2ba36b90327097f94a91cb.tar.zst go-tangerine-a8be0d9f4849d8127d2ba36b90327097f94a91cb.zip |
add InitFromString method to be used in gui
Diffstat (limited to 'ethcrypto')
-rw-r--r-- | ethcrypto/key_manager.go | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/ethcrypto/key_manager.go b/ethcrypto/key_manager.go index dcbc7b77e..066a62aab 100644 --- a/ethcrypto/key_manager.go +++ b/ethcrypto/key_manager.go @@ -115,6 +115,14 @@ func (k *KeyManager) InitFromSecretsFile(session string, cursor int, secretsfile return k.reset(session, cursor, keyRing) } +func (k *KeyManager) InitFromString(session string, cursor int, secrets string) error { + keyRing, err := NewKeyRingFromString(secrets) + if err != nil { + return err + } + return k.reset(session, cursor, keyRing) +} + func (k *KeyManager) Export(dir string) error { fileKeyStore := FileKeyStore{dir} return fileKeyStore.Save(k.session, k.keyRing) |