keystore

package
v0.15.0-rc0 Latest Latest
Warning

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

Go to latest
Published: Jul 8, 2019 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Overview

reference: https://github.com/binance-chain/go-sdk/blob/master/common/common.go

reference: https://github.com/binance-chain/go-sdk/blob/master/keys/keystore.go

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrDecrypt = errors.New("could not decrypt key with given passphrase")
)

Functions

func CombineSymbol

func CombineSymbol(baseAssetSymbol, quoteAssetSymbol string) string

func GenerateRandomBytes

func GenerateRandomBytes(n int) ([]byte, error)

GenerateRandomBytes returns securely generated random bytes. It will return an error if the system's secure random number generator fails to function correctly, in which case the caller should not continue.

func IsAlphaNum

func IsAlphaNum(s string) bool

func QueryParamToMap

func QueryParamToMap(qp interface{}) (map[string]string, error)

Types

type CryptoJSON

type CryptoJSON struct {
	Cipher       string                 `json:"cipher"`
	CipherText   string                 `json:"ciphertext"`
	CipherParams cipherparamsJSON       `json:"cipherparams"`
	KDF          string                 `json:"kdf"`
	KDFParams    map[string]interface{} `json:"kdfparams"`
	MAC          string                 `json:"mac"`
}

type EncryptedKeyJSON

type EncryptedKeyJSON struct {
	Address string     `json:"address"`
	Crypto  CryptoJSON `json:"crypto"`
	Id      string     `json:"id"`
	Version string     `json:"version"`
}

type KeyManager

type KeyManager interface {
	ExportAsKeyStore(password string) (*EncryptedKeyJSON, error)
	GetPrivKey() crypto.PrivKey
}

func NewKeyManager

func NewKeyManager(privKey crypto.PrivKey) KeyManager

func NewKeyStoreKeyManager

func NewKeyStoreKeyManager(file string, auth string) (KeyManager, error)

type PlainKeyJSON

type PlainKeyJSON struct {
	Address    string `json:"address"`
	PrivateKey string `json:"privatekey"`
	Id         string `json:"id"`
	Version    int    `json:"version"`
}

Directories

Path Synopsis
reference: https://github.com/binance-chain/go-sdk/blob/master/common/uuid/codec.go reference: https://github.com/binance-chain/go-sdk/blob/master/common/uuid/generator.go reference: https://github.com/binance-chain/go-sdk/blob/master/common/uuid/uuid.go
reference: https://github.com/binance-chain/go-sdk/blob/master/common/uuid/codec.go reference: https://github.com/binance-chain/go-sdk/blob/master/common/uuid/generator.go reference: https://github.com/binance-chain/go-sdk/blob/master/common/uuid/uuid.go

Jump to

Keyboard shortcuts

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