wallet

package
v0.9.8 Latest Latest
Warning

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

Go to latest
Published: Jul 15, 2021 License: Apache-2.0 Imports: 16 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DecryptKeyStore

func DecryptKeyStore(data, pw []byte) (*crypto.PrivateKey, error)

func EncryptKeyAsKeyStore

func EncryptKeyAsKeyStore(s *crypto.PrivateKey, pw []byte) ([]byte, error)

func KeyStoreFromWallet

func KeyStoreFromWallet(w module.Wallet, pw []byte) ([]byte, error)

func New

func New() module.Wallet

func NewFromKeyStore

func NewFromKeyStore(data, pw []byte) (module.Wallet, error)

func NewFromPrivateKey

func NewFromPrivateKey(sk *crypto.PrivateKey) (module.Wallet, error)

func OpenPlugin

func OpenPlugin(p string, opts map[string]string) (wallet module.Wallet, ret error)

func ReadAddressFromKeyStore

func ReadAddressFromKeyStore(data []byte) (module.Address, error)

func SHA3SumKeccak256

func SHA3SumKeccak256(data ...[]byte) []byte

Types

type AES128CTRParams

type AES128CTRParams struct {
	IV common.RawHexBytes `json:"iv"`
}

type CryptoData

type CryptoData struct {
	Cipher       string             `json:"cipher"`
	CipherParams json.RawMessage    `json:"cipherparams"`
	CipherText   common.RawHexBytes `json:"ciphertext"`
	KDF          string             `json:"kdf"`
	KDFParams    json.RawMessage    `json:"kdfparams"`
	MAC          common.RawHexBytes `json:"mac"`
}

type KeyStoreData

type KeyStoreData struct {
	Address  common.Address `json:"address"`
	ID       string         `json:"id"`
	Version  int            `json:"version"`
	CoinType string         `json:"coinType"`
	Crypto   CryptoData     `json:"crypto"`
}

type ScryptParams

type ScryptParams struct {
	DKLen int                `json:"dklen"`
	N     int                `json:"n"`
	R     int                `json:"r"`
	P     int                `json:"p"`
	Salt  common.RawHexBytes `json:"salt"`
}

func (*ScryptParams) Init

func (p *ScryptParams) Init() error

func (*ScryptParams) Key

func (p *ScryptParams) Key(pw []byte) ([]byte, error)

Jump to

Keyboard shortcuts

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