common

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jun 23, 2022 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WriteFile

func WriteFile(filepath string, b []byte, mode uint32) error

Types

type AES128CTRParams

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

type CryptoData

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

type KeyStoreData

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

type RawHexBytes

type RawHexBytes []byte

func (RawHexBytes) Bytes

func (rh RawHexBytes) Bytes() []byte

func (RawHexBytes) MarshalJSON

func (rh RawHexBytes) MarshalJSON() ([]byte, error)

func (RawHexBytes) String

func (rh RawHexBytes) String() string

func (*RawHexBytes) UnmarshalJSON

func (rh *RawHexBytes) UnmarshalJSON(b []byte) error

type ScryptParams

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

func (*ScryptParams) Init

func (p *ScryptParams) Init(pKey []byte) 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