wallet

package
v0.0.0-...-88bd931 Latest Latest
Warning

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

Go to latest
Published: Jun 3, 2021 License: GPL-3.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const X25519 = "x25519-xsalsa20-poly1305"

Variables

This section is empty.

Functions

func Decrypt

func Decrypt(password string, keystoredir string, encryptedData EncryptedData) ([]byte, error)

Decrypt some encrypted data.

func GetEncryptionPublicKey

func GetEncryptionPublicKey(receiverAddress string) string

GetEncryptionPublicKey returns user's public Encryption key derived from privateKey Ethereum key

func GetKeystoreDirPath

func GetKeystoreDirPath(dataDir string) string

func NewKeystoreAccount

func NewKeystoreAccount(dataDir, password string) (common.Address, error)

func RecoverPrivateKey

func RecoverPrivateKey(keystoreDir string, pwd string, address common.Address) ([]byte, error)

func Sign

func Sign(msg []byte, privKey *ecdsa.PrivateKey) (sig []byte, err error)

func SignTx

func SignTx(tx state.Tx, privKey *ecdsa.PrivateKey) (state.SignedTx, error)

func SignTxWithKeystoreAccount

func SignTxWithKeystoreAccount(tx state.Tx, address common.Address, pwd, keystoreDir string) (state.SignedTx, error)

func Verify

func Verify(msg, sig []byte) (*ecdsa.PublicKey, error)

Types

type EncryptedData

type EncryptedData struct {
	Version        string `json:"version"`
	Nonce          string `json:"nonce"`
	EphemPublicKey string `json:"public_key"`
	Ciphertext     string `json:"cipher_text"`
}

EncryptedData is encrypted blob

func Encrypt

func Encrypt(receiverPublicKey [32]byte, data []byte, version string) (*EncryptedData, error)

Encrypt plain data

type Wallet

type Wallet struct {
	// contains filtered or unexported fields
}

Jump to

Keyboard shortcuts

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