cosmos-sdk/crypto/keys
Jonathan Gimeno 2e42f9cb74
Favor marshal unmashal binare bare (#5799)
* change abci file to use BinaryBare

* change all calls to EncodeLengthPrefixed to BinaryBare in distribution keeper store.

* change all calls to EncodeLengthPrefixed to BinaryBare in mint keeper store.

* change all calls to EncodeLengthPrefixed to BinaryBare in auth keeper store.

* change all calls to EncodeLengthPrefixed to BinaryBare in distribution keeper store.

* change all calls to EncodeLengthPrefixed to BinaryBare in staking keeper store.

* change all calls to EncodeLengthPrefixed to BinaryBare in staking keeper store.

* change all calls to EncodeLengthPrefixed to BinaryBare in gov keeper store.

* change all calls to EncodeLengthPrefixed to BinaryBare in slashing keeper store.

* update decoder test

* migrate decoder

* migrate gov simulation decoder

* migrate baseapp_test

* refactor QuerySubspace

* refactor coedc std codec

* migrate keybase

* migrate iavl store

* migrate root multi

* migrate ante basic

* migrate tx type to bare

* migrate auth client

* update auth types

* update decoder

* migrate supply decoder

* migrate stake encoding

* migrate staking simulation

* migrate genutil

* migrate simapp test helpers

* migrate docs

* upgrade changelog

* Update CHANGELOG.md

Co-Authored-By: Alexander Bezobchuk <alexanderbez@users.noreply.github.com>

Co-authored-by: Alexander Bezobchuk <alexanderbez@users.noreply.github.com>
2020-03-13 19:58:43 +00:00
..
hd Merge PR #5192: golangcI-lint updates & set static version to 1.19 2019-10-14 11:43:19 -04:00
keyerror crypto: cleanup, more testing 2020-03-02 11:09:52 +00:00
mintkey crypto: cleanup, more testing 2020-03-02 11:09:52 +00:00
README.md keyring's encrypted file backend integration (#5355) 2019-12-11 09:45:26 +00:00
codec.go Interchangable PrivKey implementations in keybase (#5278) 2019-12-12 21:52:24 +00:00
keybase.go crypto: cleanup, more testing 2020-03-02 11:09:52 +00:00
keybase_base.go Favor marshal unmashal binare bare (#5799) 2020-03-13 19:58:43 +00:00
keybase_test.go crypto: cleanup, more testing 2020-03-02 11:09:52 +00:00
keyring.go crypto: print an error message if the password input failed (#5739) 2020-03-03 13:32:52 +00:00
keyring_test.go crypto: cleanup, more testing 2020-03-02 11:09:52 +00:00
keys.go Merge PR #5439: Keybase: Multiple Signature Algorithms 2020-01-14 10:40:10 -05:00
keys.toml Ledger integration (#931) 2018-06-29 02:54:47 +02:00
lazy_keybase.go Merge PR #5527: Bump Tendermint Version to v0.33.0 2020-01-16 13:46:51 -08:00
lazy_keybase_test.go Replace defer with testing.T.Cleanup() (#5732) 2020-03-02 00:16:23 +00:00
output.go Merge PR #5495: Replace Redundant Bech32 PubKey Functions 2020-01-09 09:04:28 -05:00
output_test.go Merge PR #5495: Replace Redundant Bech32 PubKey Functions 2020-01-09 09:04:28 -05:00
types.go Favor marshal unmashal binare bare (#5799) 2020-03-13 19:58:43 +00:00
types_test.go Merge PR #5439: Keybase: Multiple Signature Algorithms 2020-01-14 10:40:10 -05:00

README.md

Keys API

API Reference

The Keybase interface

The Keybase interface defines the methods that a type needs to implement to be used as key storage backend. This package provides few implementations out-of-the-box.

Constructors

New

The New constructor returns an on-disk implementation backed by LevelDB storage that has been the default implementation used by the SDK until v0.38.0. Due to security concerns, we recommend to drop it in favor of the NewKeyring or NewKeyringFile constructors. We strongly advise to migrate away from this function as it may be removed in a future release.

NewInMemory

The NewInMemory constructor returns an implementation backed by an in-memory, goroutine-safe map that we've historically used for testing purposes or on-the-fly key generation and we consider safe for the aforementioned use cases since the generated keys are discarded when the process terminates or the type instance is garbage collected.

NewKeyring

The NewKeyring constructor returns an implementation backed by the Keyring library, whose aim is to provide a common abstraction and uniform interface between secret stores available for Windows, macOS, and most GNU/Linux distributions. The instance returned by this constructor will use the operating system's default credentials store, which will then handle keys storage operations securely.

NewKeyringFile, NewTestKeyring

Both NewKeyringFile and NewTestKeyring constructors return on-disk implementations backed by the Keyring file backend. Whilst NewKeyringFile returns a secure, encrypted file-based type that requires user's password in order to function correctly, the implementation returned by NewTestKeyring stores keys information in clear text and must be used only for testing purposes.

NewKeyringFile and NewTestKeyring store key files in the client home directory's keyring and keyring-test subdirectories respectively.