account

package
v6.0.0 Latest Latest
Warning

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

Go to latest
Published: Oct 10, 2019 License: ISC Imports: 14 Imported by: 0

Documentation

Overview

Package account contains code for managing account keypairs as well as saving them securely to disk.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetWalletPath

func GetWalletPath(path string) (walletPath string, err error)

GetWalletPath checks if a file exists at the specified path.

func KeystoreSeal

func KeystoreSeal(account *Account, password string) (j []byte, e error)

KeystoreSeal create an encrypted json keystore with the private key of the account

func StoreToKeyStoreFile

func StoreToKeyStoreFile(account *Account, password, walletName string) (filePath string, err error)

StoreToKeyStoreFile saves an encrypted Account to a JSON file

func Verify

func Verify(address string, message, signature []byte) (valid bool, err error)

Verify a message with the signing/private key

Types

type Account

type Account struct {
	SigningKey ed25519.PrivateKey
	Address    string
}

Account holds the signing/private key and the aeternity account address

func FromHexString

func FromHexString(hexPrivateKey string) (account *Account, err error)

FromHexString creates an Account from a hexstring

func KeystoreOpen

func KeystoreOpen(data []byte, password string) (account *Account, err error)

KeystoreOpen open and decrypt a keystore

func LoadFromKeyStoreFile

func LoadFromKeyStoreFile(keyFile, password string) (account *Account, err error)

LoadFromKeyStoreFile loads an encrypted Account from a JSON file

func New

func New() (account *Account, err error)

New generates a new Account

func (*Account) Sign

func (account *Account) Sign(message []byte) (signature []byte)

Sign a message with the signing/private key

func (*Account) SigningKeyToHexString

func (account *Account) SigningKeyToHexString() (signingKeyHex string)

SigningKeyToHexString returns the SigningKey as an hex string

Jump to

Keyboard shortcuts

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