vault

package
v0.7.6 Latest Latest
Warning

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

Go to latest
Published: Jul 23, 2018 License: MIT Imports: 16 Imported by: 0

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)

func NewVaultFromSingleKey

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

func NewVaultFromWalletFile

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

func (*Vault) AddPrivateKey added in v0.6.0

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

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

func (*Vault) PrintPublicKeys

func (v *Vault) PrintPublicKeys()

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