container

package
v0.0.0-...-eb21b60 Latest Latest
Warning

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

Go to latest
Published: Nov 11, 2018 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WriteToFile

func WriteToFile(c Container, path string) error

WriteToFile encodes an account container to a file.

Types

type Container

type Container struct {
	PublicKey           string `json:"public"`
	EncryptedPrivateKey string `json:"private"`
}

Container is a serializable wrapper for encrypted private keys.

func New

func New(passphrase []byte, acc *account.Private) (Container, error)

New creates a new container with the given passphrase and private key.

func ReadFromFile

func ReadFromFile(path string) (Container, error)

ReadFromFile decodes an account container from file.

func (Container) Unlock

func (c Container) Unlock(passphrase []byte) (*account.Private, error)

Unlock decrypts the contained private key and returns the account.

Jump to

Keyboard shortcuts

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