vault

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Sep 21, 2018 License: MIT Imports: 16 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BlobV1 added in v0.6.8

type BlobV1 struct {
	Version       int      `bson:"version"`
	WrappedDEK    string   `bson:"wrapped_dek"`
	Nonce         [24]byte `bson:"nonce"`
	EncryptedData []byte   `bson:"data"`
}

type KMSGCPBoxer added in v0.6.8

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

func NewKMSGCPBoxer added in v0.6.8

func NewKMSGCPBoxer(keyPath string) *KMSGCPBoxer

func (*KMSGCPBoxer) Open added in v0.6.8

func (b *KMSGCPBoxer) Open(in string) ([]byte, error)

func (*KMSGCPBoxer) Seal added in v0.6.8

func (b *KMSGCPBoxer) Seal(in []byte) (string, error)

func (*KMSGCPBoxer) WrapType added in v0.6.8

func (b *KMSGCPBoxer) WrapType() string

type KMSGCPManager added in v0.6.8

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

func NewKMSGCPManager added in v0.6.8

func NewKMSGCPManager(keyPath string) (*KMSGCPManager, error)

func (*KMSGCPManager) Decrypt added in v0.6.8

func (k *KMSGCPManager) Decrypt(in []byte) ([]byte, error)

func (*KMSGCPManager) Encrypt added in v0.6.8

func (k *KMSGCPManager) Encrypt(in []byte) ([]byte, error)

type KMSManager added in v0.6.8

type KMSManager interface {
	Encrypt([]byte) ([]byte, error)
	Decrypt([]byte) ([]byte, error)
}

type PassphraseBoxer added in v0.6.8

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

func NewPassphraseBoxer added in v0.6.8

func NewPassphraseBoxer(password string) *PassphraseBoxer

func (*PassphraseBoxer) Open added in v0.6.8

func (b *PassphraseBoxer) Open(in string) ([]byte, error)

func (*PassphraseBoxer) Seal added in v0.6.8

func (b *PassphraseBoxer) Seal(in []byte) (string, error)

func (*PassphraseBoxer) WrapType added in v0.6.8

func (b *PassphraseBoxer) WrapType() string

type PassthroughKeyManager added in v0.6.8

type PassthroughKeyManager struct{}

func NewPassthroughKeyManager added in v0.6.8

func NewPassthroughKeyManager() *PassthroughKeyManager

func (PassthroughKeyManager) Decrypt added in v0.6.8

func (k PassthroughKeyManager) Decrypt(in []byte) ([]byte, error)

func (PassthroughKeyManager) Encrypt added in v0.6.8

func (k PassthroughKeyManager) Encrypt(in []byte) ([]byte, error)

type SecretBoxer added in v0.6.8

type SecretBoxer interface {
	Seal(in []byte) (string, error)
	Open(in string) ([]byte, error)
	WrapType() string
}

func SecretBoxerForType added in v0.6.8

func SecretBoxerForType(boxerType string, keypath string) (SecretBoxer, error)

type Vault

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

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

	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)

NewVaultFromKeysFile creates a new Vault from the keys in the provided keys file. keysFile should be formatted with a single private key per line

func NewVaultFromSingleKey

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

NewVaultFromSingleKey creates a new Vault from the provided private key.

func NewVaultFromWalletFile

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

NewVaultFromWalletFile returns a new Vault instance from the provided filename of an eos wallet.

func (*Vault) AddPrivateKey added in v0.6.0

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

AddPrivateKey appends the provided private key into the Vault's KeyBag

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) Open added in v0.6.8

func (v *Vault) Open(boxer SecretBoxer) error

func (*Vault) PrintPrivateKeys added in v0.7.7

func (v *Vault) PrintPrivateKeys()

func (*Vault) PrintPublicKeys

func (v *Vault) PrintPublicKeys()

PrintPublicKeys prints a PublicKey corresponding to each PrivateKey in the Vault's KeyBag.

func (*Vault) Seal added in v0.6.8

func (v *Vault) Seal(boxer SecretBoxer) error

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