{"modulePath":"github.com/codexnetwork/codexcli","version":"v1.2.1","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package vault\n\n## Types\n\n```go\ntype BlobV1 struct {\n\tVersion       int      `bson:\"version\"`\n\tWrappedDEK    string   `bson:\"wrapped_dek\"`\n\tNonce         [24]byte `bson:\"nonce\"`\n\tEncryptedData []byte   `bson:\"data\"`\n}\n```\n\n```go\ntype KMSGCPBoxer struct {\n\t// contains filtered or unexported fields\n}\n```\n\n```go\nfunc NewKMSGCPBoxer(keyPath string) *KMSGCPBoxer\n```\n\n```go\nfunc (b *KMSGCPBoxer) Open(in string) ([]byte, error)\n```\n\n```go\nfunc (b *KMSGCPBoxer) Seal(in []byte) (string, error)\n```\n\n```go\nfunc (b *KMSGCPBoxer) WrapType() string\n```\n\n```go\ntype KMSGCPManager struct {\n\t// contains filtered or unexported fields\n}\n```\n\n```go\nfunc NewKMSGCPManager(keyPath string) (*KMSGCPManager, error)\n```\n\n```go\nfunc (k *KMSGCPManager) Decrypt(in []byte) ([]byte, error)\n```\n\n```go\nfunc (k *KMSGCPManager) Encrypt(in []byte) ([]byte, error)\n```\n\n```go\ntype KMSManager interface {\n\tEncrypt([]byte) ([]byte, error)\n\tDecrypt([]byte) ([]byte, error)\n}\n```\n\n```go\ntype PassphraseBoxer struct {\n\t// contains filtered or unexported fields\n}\n```\n\n```go\nfunc NewPassphraseBoxer(password string) *PassphraseBoxer\n```\n\n```go\nfunc (b *PassphraseBoxer) Open(in string) ([]byte, error)\n```\n\n```go\nfunc (b *PassphraseBoxer) Seal(in []byte) (string, error)\n```\n\n```go\nfunc (b *PassphraseBoxer) WrapType() string\n```\n\n```go\ntype PassthroughKeyManager struct{}\n```\n\n```go\nfunc NewPassthroughKeyManager() *PassthroughKeyManager\n```\n\n```go\nfunc (k PassthroughKeyManager) Decrypt(in []byte) ([]byte, error)\n```\n\n```go\nfunc (k PassthroughKeyManager) Encrypt(in []byte) ([]byte, error)\n```\n\n```go\ntype SecretBoxer interface {\n\tSeal(in []byte) (string, error)\n\tOpen(in string) ([]byte, error)\n\tWrapType() string\n}\n```\n\n```go\nfunc SecretBoxerForType(boxerType string, keypath string) (SecretBoxer, error)\n```\n\n```go\ntype Vault struct {\n\tKind    string `json:\"kind\"`\n\tVersion int    `json:\"version\"`\n\tComment string `json:\"comment\"`\n\n\tSecretBoxWrap       string `json:\"secretbox_wrap\"`\n\tSecretBoxCiphertext string `json:\"secretbox_ciphertext\"`\n\n\tKeyBag *eos.KeyBag `json:\"-\"`\n}\n```\nVault 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).\n\n```go\nfunc NewVault() *Vault\n```\nNewVault returns an empty vault, unsaved and with no keys.\n\n```go\nfunc NewVaultFromKeysFile(keysFile string) (*Vault, error)\n```\nNewVaultFromKeysFile creates a new Vault from the keys in the provided keys file. keysFile should be formatted with a single private key per line\n\n```go\nfunc NewVaultFromSingleKey(privKey string) (*Vault, error)\n```\nNewVaultFromSingleKey creates a new Vault from the provided private key.\n\n```go\nfunc NewVaultFromWalletFile(filename string) (*Vault, error)\n```\nNewVaultFromWalletFile returns a new Vault instance from the provided filename of an eos wallet.\n\n```go\nfunc (v *Vault) AddPrivateKey(privateKey *ecc.PrivateKey) (pub ecc.PublicKey)\n```\nAddPrivateKey appends the provided private key into the Vault's KeyBag\n\n```go\nfunc (v *Vault) NewKeyPair() (pub ecc.PublicKey, err error)\n```\nNewKeyPair 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.\n\n```go\nfunc (v *Vault) Open(boxer SecretBoxer) error\n```\n\n```go\nfunc (v *Vault) PrintPrivateKeys()\n```\n\n```go\nfunc (v *Vault) PrintPublicKeys()\n```\nPrintPublicKeys prints a PublicKey corresponding to each PrivateKey in the Vault's KeyBag.\n\n```go\nfunc (v *Vault) Seal(boxer SecretBoxer) error\n```\n\n```go\nfunc (v *Vault) WriteToFile(filename string) error\n```\nWriteToFile writes the Vault to disk. You need to encrypt before writing to file, otherwise you might lose much :)\n\n","path":"github.com/codexnetwork/codexcli/vault","name":"vault","synopsis":"","isRedistributable":true}
