From a8be0d9f4849d8127d2ba36b90327097f94a91cb Mon Sep 17 00:00:00 2001 From: zelig Date: Sun, 29 Jun 2014 20:26:55 +0100 Subject: add InitFromString method to be used in gui --- ethcrypto/key_manager.go | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'ethcrypto/key_manager.go') 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) -- cgit