keys

package
v1.9.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 30, 2021 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type KeyEntry

type KeyEntry struct {
	Address   string `json:"address"`
	PubKey    []byte `json:"pub_key"`
	PrivKey   []byte `json:"priv_key"`
	Encrypted bool   `json:"encrypted"`
}

func GenerateKey

func GenerateKey(seed string, passphrase []byte, encrypt bool) (*KeyEntry, error)

func ImportKey

func ImportKey(keyBytes []byte, passphrase []byte, encrypt bool) (*KeyEntry, error)

func (*KeyEntry) Decrypt

func (key *KeyEntry) Decrypt(passphrase []byte) error

type KeyRing

type KeyRing struct {
	// contains filtered or unexported fields
}

func GetKeyRing

func GetKeyRing(path string) (*KeyRing, error)

func (*KeyRing) AddKey

func (kr *KeyRing) AddKey(username string, key *KeyEntry) error

func (*KeyRing) GenerateNewKey

func (kr *KeyRing) GenerateNewKey(username string, seed string, passphrase []byte, encrypt bool) (*KeyEntry, error)

func (*KeyRing) GetFirstKey

func (kr *KeyRing) GetFirstKey() *KeyEntry

func (*KeyRing) GetKey

func (kr *KeyRing) GetKey(username string) *KeyEntry

func (*KeyRing) GetNumKeys

func (kr *KeyRing) GetNumKeys() int

func (*KeyRing) ImportNewKey

func (kr *KeyRing) ImportNewKey(username string, keyBytes []byte, passphrase []byte, encrypt bool) (*KeyEntry, error)

func (*KeyRing) Load

func (kr *KeyRing) Load() error

func (*KeyRing) PrintKeyList

func (kr *KeyRing) PrintKeyList(withPubKey bool)

func (*KeyRing) RemoveKey

func (kr *KeyRing) RemoveKey(username string) error

func (*KeyRing) Save

func (kr *KeyRing) Save() error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL