Documentation ¶
Index ¶
- Variables
- func CreatePackerKey(address common.Address, password string, keyfile string) crypto.PublicKey
- func DecryptData(cryptoJson cryptoJSON, auth string) ([]byte, error)
- func EncryptData(data, auth []byte, scryptN, scryptP int) (cryptoJSON, error)
- func PublicKeyForPacker(key crypto.PublicKey) types.PackerECPubKey
- type AccountKey
- type MiningKey
- type MiningKeyManager
- func (s *MiningKeyManager) CreateKey(address common.Address) crypto.PublicKey
- func (s *MiningKeyManager) Keys() map[common.Address]MiningKeys
- func (s *MiningKeyManager) Load() error
- func (s *MiningKeyManager) Sign(address common.Address, pubkey MiningPubkey, hash []byte) ([]byte, error)
- func (s *MiningKeyManager) Start()
- func (s *MiningKeyManager) Stop()
- type MiningKeys
- type MiningPubkey
- type PackerKey
- type PackerKeyManager
- func (s *PackerKeyManager) CreateKey(address common.Address) crypto.PublicKey
- func (s *PackerKeyManager) GetPrivateKey(address common.Address, pubkey types.PackerECPubKey) (crypto.PrivateKey, error)
- func (s *PackerKeyManager) Keys() map[common.Address]PackerKeys
- func (s *PackerKeyManager) Load() error
- func (s *PackerKeyManager) Start()
- func (s *PackerKeyManager) Stop()
- type PackerKeys
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 DecryptData ¶
func EncryptData ¶
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 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
Click to show internal directories.
Click to hide internal directories.