acc

package
v0.0.0-...-1caa7d0 Latest Latest
Warning

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

Go to latest
Published: Dec 20, 2021 License: MIT Imports: 18 Imported by: 1

Documentation

Index

Constants

View Source
const DataId = "aes-256-cbc"

DataId is the encryption method used.

View Source
const KeyId = "scrypt"

KeyId is the key derivation method.

Variables

This section is empty.

Functions

func Create

func Create(name, pass string) (crypto.Account, error)

func DevFunding

func DevFunding(address string, amount uint64) error

func Info

func Info(name, pass string) (models.Account, error)

func Load

func Load(name, pass string) (crypto.Account, error)

func LoadAccountFromFile

func LoadAccountFromFile(pass, path string) (crypto.Account, error)

func SaveAccountToFile

func SaveAccountToFile(acc crypto.Account, pass, path string) error

Types

type KeyData

type KeyData struct {
	T string `json:"t"`
	S string `json:"s"`
	D string `json:"d"`
}

KeyData holds the encrypted data and the initial vector.

type KeyInfo

type KeyInfo struct {
	T string `json:"t"`
	S string `json:"s"`
	N uint64 `json:"n"`
	P uint64 `json:"p"`
	R uint64 `json:"r"`
	L uint64 `json:"l"`
}

KeyInfo holds the key derivation values. S 32 (salt) N 2048 (cpu cost) R 8 (blocksize) P 1 (parallelize) l 32 (dklen)

type KeyStore

type KeyStore struct {
	Id  string `json:"id"`
	Ver uint64 `json:"ver"`

	Key  KeyInfo `json:"key"`
	Data KeyData `json:"data"`
	Type KeyType `json:"type"`
}

KeyStore holds values to store account keys.

type KeyType

type KeyType struct {
	K string `json:"k"`
	D string `json:"d"`
}

KeyTypes holds the type of key derivation and cipher methodes.

Jump to

Keyboard shortcuts

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