Documentation ¶
Index ¶
- Variables
- type Config
- type KeyConfig
- type KeyInfo
- type Transit
- func (c *Transit) Backup(ctx context.Context) (backup string, err error)
- func (c *Transit) Config(ctx context.Context, keycfg *KeyConfig) (err error)
- func (c *Transit) Decrypt(ctx context.Context, a string) (text string, err error)
- func (c *Transit) Delete(ctx context.Context) (err error)
- func (c *Transit) Encrypt(ctx context.Context, a string) (cipher string, version int64, err error)
- func (c *Transit) ListKeys(ctx context.Context) (keys []interface{}, err error)
- func (c *Transit) NewKeyConfig() (*KeyConfig, error)
- func (c *Transit) Read(ctx context.Context) (key *KeyInfo, err error)
- func (c *Transit) Restore(ctx context.Context, backup string) (err error)
- func (c *Transit) Rewrap(ctx context.Context, a string) (cipher string, version int64, err error)
- func (c *Transit) Rotate(ctx context.Context) (err error)
- func (c *Transit) Trim(ctx context.Context, d int64) (err error)
Constants ¶
This section is empty.
Variables ¶
var (
ErrNoKey = errors.New("no key provided")
)
Functions ¶
This section is empty.
Types ¶
type KeyInfo ¶ added in v1.4.4
type KeyInfo struct { Name string `mapstructure:"name"` Type string `mapstructure:"type"` Keys struct { Num1 int64 `mapstructure:"1"` } `mapstructure:"keys"` MinEncryptionVersion int64 `mapstructure:"min_encryption_version"` MinDecryptionVersion int64 `mapstructure:"min_decryption_version"` AllowPlaintextBackup bool `mapstructure:"allow_plaintext_backup"` Exportable bool `mapstructure:"exportable"` Derived bool `mapstructure:"derived"` DeletionAllowed bool `mapstructure:"deletion_allowed"` SupportsEncryption bool `mapstructure:"supports_encryption"` SupportsDecryption bool `mapstructure:"supports_decryption"` SupportsDerivation bool `mapstructure:"supports_derivation"` SupportsSigning bool `mapstructure:"supports_signing"` }
type Transit ¶
type Transit struct { Key string // contains filtered or unexported fields }
func NewTransitClient ¶
NewTransitClient - Generate new transit client.
func (*Transit) Backup ¶
Backup returns a plaintext backup of a named key. The backup contains all the configuration data and keys of all the versions along with the HMAC key. https://www.vaultproject.io/api/secret/transit#backup-key
func (*Transit) Config ¶
Config key - Allows tuning configuration values for a given key. https://www.vaultproject.io/api/secret/transit#update-key-configuration
func (*Transit) Decrypt ¶
Decrypt the provided ciphertext using the named key. https://www.vaultproject.io/api/secret/transit#decrypt-data
func (*Transit) Delete ¶
Delete a named encryption key. It will no longer be possible to decrypt any data encrypted with the named key. https://www.vaultproject.io/api/secret/transit#delete-key
func (*Transit) Encrypt ¶
Encrypt the provided plaintext using the named key. https://www.vaultproject.io/api/secret/transit#encrypt-data
func (*Transit) ListKeys ¶ added in v1.4.3
ListKeys returns a list of keys. Only the key names are returned (not the actual keys themselves). https://www.vaultproject.io/api/secret/transit#list-keys
func (*Transit) NewKeyConfig ¶ added in v1.4.4
NewKeyConfig - Generate new key configuration.
func (*Transit) Read ¶
Read returns information about a named encryption key. https://www.vaultproject.io/api/secret/transit#read-key
func (*Transit) Restore ¶
Restore the backup as a named key. This will restore the key configurations and all the versions of the named key along with HMAC keys.
func (*Transit) Rewrap ¶
Rewrap the provided ciphertext using the latest version of the named key. Because this never returns plaintext, it is possible to delegate this functionality to untrusted users or scripts.. https://www.vaultproject.io/api/secret/transit#rewrap-data
func (*Transit) Rotate ¶
Rotate the version of the named key. After rotation, new plaintext requests will be encrypted with the new version of the key. https://www.vaultproject.io/api/secret/transit#rotate-key