accounts: improve API and add documentation

- Sign takes common.Address, not Account
- Import/Export methods work with encrypted JSON keys
This commit is contained in:
Felix Lange
2016-04-05 01:08:50 +02:00
parent 91aaddaeb3
commit 46df50be18
6 changed files with 97 additions and 58 deletions

View File

@ -146,9 +146,9 @@ func newKeyFromECDSA(privateKeyECDSA *ecdsa.PrivateKey) *Key {
return key
}
// generate key whose address fits into < 155 bits so it can fit into
// the Direct ICAP spec. for simplicity and easier compatibility with
// other libs, we retry until the first byte is 0.
// NewKeyForDirectICAP generates a key whose address fits into < 155 bits so it can fit
// into the Direct ICAP spec. for simplicity and easier compatibility with other libs, we
// retry until the first byte is 0.
func NewKeyForDirectICAP(rand io.Reader) *Key {
randBytes := make([]byte, 64)
_, err := rand.Read(randBytes)