Documentation ¶
Index ¶
- func PubKeyFromBytes(pubKeyBytes []byte) (pubKey cryptotypes.PubKey, err error)
- func RegisterCodec(cdc *codec.LegacyAmino)
- type AES
- type Crypto
- type FileDAO
- type Info
- type KeyDAO
- type KeyInfo
- type KeyType
- type LevelDBDAO
- func (k LevelDBDAO) Delete(name, password string) error
- func (k LevelDBDAO) Has(name string) bool
- func (k LevelDBDAO) Read(name, password string) (store KeyInfo, err error)
- func (k LevelDBDAO) ReadMetadata(name string) (store KeyInfo, err error)
- func (k LevelDBDAO) Write(name, password string, info KeyInfo) error
- type MemoryDAO
- func (m MemoryDAO) Delete(name, password string) error
- func (m MemoryDAO) Has(name string) bool
- func (m MemoryDAO) Read(name, password string) (KeyInfo, error)
- func (m MemoryDAO) ReadMetadata(name string) (store KeyInfo, err error)
- func (m MemoryDAO) Write(name, password string, store KeyInfo) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func PubKeyFromBytes ¶
func PubKeyFromBytes(pubKeyBytes []byte) (pubKey cryptotypes.PubKey, err error)
PubKeyFromBytes unmarshals public key bytes and returns a PubKey
func RegisterCodec ¶
func RegisterCodec(cdc *codec.LegacyAmino)
RegisterCodec registers concrete types and interfaces on the given codec.
Types ¶
type FileDAO ¶
type FileDAO struct {
// contains filtered or unexported fields
}
Execute the local file system to realize the persistence of the key data, and the stored data is encrypted using `PBES2`. Can directly read the data of `iritacli` keys (--keyring-backend = file)
type Info ¶
type Info interface { // Human-readable type for key listing GetType() KeyType // Name of the key GetName() string // Public key GetPubKey() cryptotypes.PubKey // Bip44 Path GetPath() (*hd.BIP44Params, error) // Algo GetAlgo() hd.PubKeyType }
Info is the publicly exposed information about a keypair
type KeyDAO ¶
type KeyDAO interface { // Write will use user password to encrypt data and save to file, the file name is user name Write(name, password string, store KeyInfo) error // Read will read encrypted data from file and decrypt with user password Read(name, password string) (KeyInfo, error) // Delete will delete user data and use user password to verify permissions Delete(name, password string) error // Has returns whether the specified user name exists Has(name string) bool }
func NewFileDAO ¶
type KeyInfo ¶
type KeyInfo struct { Name string `json:"name"` PubKey []byte `json:"pubkey"` PrivKeyArmor string `json:"priv_key_armor"` Algo string `json:"algo"` }
KeyInfo saves the basic information of the key
type KeyType ¶
type KeyType uint
KeyType reflects a human-readable type for key listing.
const (
TypeLocal KeyType = 0
)
Info KeyTypes
type LevelDBDAO ¶
type LevelDBDAO struct { Crypto // contains filtered or unexported fields }
func (LevelDBDAO) Delete ¶
func (k LevelDBDAO) Delete(name, password string) error
Delete delete a key from the local store
func (LevelDBDAO) Has ¶
func (k LevelDBDAO) Has(name string) bool
Delete delete a key from the local store
func (LevelDBDAO) Read ¶
func (k LevelDBDAO) Read(name, password string) (store KeyInfo, err error)
Read read a key information from the local store
func (LevelDBDAO) ReadMetadata ¶
func (k LevelDBDAO) ReadMetadata(name string) (store KeyInfo, err error)
ReadMetadata read a key information from the local store
type MemoryDAO ¶
type MemoryDAO struct { Crypto // contains filtered or unexported fields }
Use memory as storage, use with caution in build environment
func (MemoryDAO) ReadMetadata ¶
ReadMetadata read a key information from the local store