diff options
author | Gustav Simonsson <gustav.simonsson@gmail.com> | 2015-04-21 23:00:30 +0800 |
---|---|---|
committer | Gustav Simonsson <gustav.simonsson@gmail.com> | 2015-05-12 23:22:17 +0800 |
commit | f98e002d9851b8df53a09a0e3189f2e8fdec48df (patch) | |
tree | 611b0f65f80cee91c62716ae18f43aaaed61bc96 /crypto/key_store_plain.go | |
parent | 313eec33ad7add82bfdd00e3a076091fa990c799 (diff) | |
download | dexon-f98e002d9851b8df53a09a0e3189f2e8fdec48df.tar.gz dexon-f98e002d9851b8df53a09a0e3189f2e8fdec48df.tar.zst dexon-f98e002d9851b8df53a09a0e3189f2e8fdec48df.zip |
Address pull request comments; key header and hex encoding
* Remove key header from unencrypted key file format and replace
it with a version field
* Change encoding of bytes in key files from base64 to hex
Diffstat (limited to 'crypto/key_store_plain.go')
-rw-r--r-- | crypto/key_store_plain.go | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/crypto/key_store_plain.go b/crypto/key_store_plain.go index 2ade11985..6a8afe27d 100644 --- a/crypto/key_store_plain.go +++ b/crypto/key_store_plain.go @@ -98,12 +98,12 @@ func (ks keyStorePlain) DeleteKey(keyAddr common.Address, auth string) (err erro } func GetKeyFile(keysDirPath string, keyAddr common.Address) (fileContent []byte, err error) { - fileName := keyAddr.Hex() + fileName := hex.EncodeToString(keyAddr[:]) return ioutil.ReadFile(filepath.Join(keysDirPath, fileName, fileName)) } func WriteKeyFile(addr common.Address, keysDirPath string, content []byte) (err error) { - addrHex := addr.Hex() + addrHex := hex.EncodeToString(addr[:]) keyDirPath := filepath.Join(keysDirPath, addrHex) keyFilePath := filepath.Join(keyDirPath, addrHex) err = os.MkdirAll(keyDirPath, 0700) // read, write and dir search for user |