keys

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Oct 30, 2019 License: LGPL-3.0 Imports: 24 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrDecrypt      = errors.New("could not decrypt key with given passphrase")
	ErrNoMatch      = errors.New("no key for given address or file")
	ErrNotSupport   = errors.New("this function is not support")
	ErrAddrNotMatch = errors.New("the address is not match the account")
	ErrEmptyAddr    = errors.New("the address is empty")
	ErrNoValidKey   = errors.New("there is no valid key for this round")
)

Functions

func CreatePackerKey

func CreatePackerKey(address common.Address, password string, keyfile string) crypto.PublicKey

func DecryptData

func DecryptData(cryptoJson cryptoJSON, auth string) ([]byte, error)

func EncryptData

func EncryptData(data, auth []byte, scryptN, scryptP int) (cryptoJSON, error)

Encryptdata encrypts the data given as 'data' with the password 'auth'.

func PublicKeyForPacker

func PublicKeyForPacker(key crypto.PublicKey) types.PackerECPubKey

Types

type AccountKey

type AccountKey struct {
	Address common.Address
	PrivKey crypto.PrivateKey
}

func CreateAccountKey

func CreateAccountKey(keyfile string, password string) *AccountKey

func LoadAccountKey

func LoadAccountKey(path string, password string) (*AccountKey, error)

type MiningKey

type MiningKey struct {
	Address    common.Address
	PrivKey    crypto.PrivateKey
	CreateTime int64
}

type MiningKeyManager

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

func NewMiningKeyManager

func NewMiningKeyManager(directory string, password string) *MiningKeyManager

func (*MiningKeyManager) CreateKey

func (s *MiningKeyManager) CreateKey(address common.Address) crypto.PublicKey

func (*MiningKeyManager) Keys

func (s *MiningKeyManager) Keys() map[common.Address]MiningKeys

func (*MiningKeyManager) Load

func (s *MiningKeyManager) Load() error

func (*MiningKeyManager) Sign

func (s *MiningKeyManager) Sign(address common.Address, pubkey MiningPubkey, hash []byte) ([]byte, error)

func (*MiningKeyManager) Start

func (s *MiningKeyManager) Start()

func (*MiningKeyManager) Stop

func (s *MiningKeyManager) Stop()

type MiningKeys

type MiningKeys map[MiningPubkey]*MiningKey

type MiningPubkey

type MiningPubkey [crypto.BlsPubkeyLen]byte

func PublicKeyForMining

func PublicKeyForMining(key crypto.PublicKey) MiningPubkey

type PackerKey

type PackerKey struct {
	Address common.Address
	PrivKey crypto.PrivateKey
}

func LoadPackerKey

func LoadPackerKey(path string, password string) (*PackerKey, error)

type PackerKeyManager

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

func NewPackerKeyManager

func NewPackerKeyManager(directory string, password string) *PackerKeyManager

func (*PackerKeyManager) CreateKey

func (s *PackerKeyManager) CreateKey(address common.Address) crypto.PublicKey

func (*PackerKeyManager) GetPrivateKey

func (s *PackerKeyManager) GetPrivateKey(address common.Address, pubkey types.PackerECPubKey) (crypto.PrivateKey, error)

func (*PackerKeyManager) Keys

func (s *PackerKeyManager) Keys() map[common.Address]PackerKeys

func (*PackerKeyManager) Load

func (s *PackerKeyManager) Load() error

func (*PackerKeyManager) Start

func (s *PackerKeyManager) Start()

func (*PackerKeyManager) Stop

func (s *PackerKeyManager) Stop()

type PackerKeys

type PackerKeys map[types.PackerECPubKey]*PackerKey

Jump to

Keyboard shortcuts

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