vault

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: May 30, 2018 License: MIT Imports: 10 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ShamirWrapping added in v0.5.0

type ShamirWrapping struct {
	Shares    int      `json:"shares"`
	Threshold int      `json:"threshold"`
	Parts     [][]byte `json:"parts"`
}

type Vault

type Vault struct {
	Kind    string `json:"kind"`
	Version int    `json:"version"`
	Comment string `json:"comment"`

	Shamir *ShamirWrapping `json:"shamir,omitempty"`

	SecretBoxWrap       string `json:"secretbox_wrap"`
	SecretBoxCiphertext string `json:"secretbox_ciphertext"`

	PublicKeys []string `json:"public_keys"`

	KeyBag *eos.KeyBag `json:"-"`
}

Vault represents an `eosc` wallet. It contains the encrypted material to load a KeyBag, which is the signing provider for signing transactions using the `eos-go` library (which includes the embedded keosd-compatible wallet).

func NewVault

func NewVault() *Vault

NewVault returns an empty vault, unsaved and with no keys.

func NewVaultFromKeysFile

func NewVaultFromKeysFile(keysFile string) (*Vault, error)

func NewVaultFromSingleKey

func NewVaultFromSingleKey(privKey string) (*Vault, error)

func NewVaultFromWalletFile

func NewVaultFromWalletFile(filename string) (*Vault, error)

func (*Vault) AddPrivateKey

func (v *Vault) AddPrivateKey(privateKey *ecc.PrivateKey) (pub ecc.PublicKey)

func (*Vault) NewKeyPair

func (v *Vault) NewKeyPair() (pub ecc.PublicKey, err error)

NewKeyPair creates a new EOS keypair, saves the private key in the local wallet and returns the public key. It does NOT save the wallet, you better do that soon after.

func (*Vault) OpenWithPassphrase added in v0.5.0

func (v *Vault) OpenWithPassphrase(passphrase string) error

OpenWithPassphrase will load the KeyBag from the decrypted material, unlocked with the passphrase.

func (*Vault) PrintPublicKeys

func (v *Vault) PrintPublicKeys()

func (*Vault) SealWithPassphrase added in v0.5.0

func (v *Vault) SealWithPassphrase(passphrase string) error

SealWithPassphrases uses the passphrase-based encryption.

func (*Vault) WriteToFile

func (v *Vault) WriteToFile(filename string) error

WriteToFile writes the Vault to disk. You need to encrypt before writing to file, otherwise you might lose much :)

Jump to

Keyboard shortcuts

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