Documentation ¶
Index ¶
- type MasterKey
- func (key *MasterKey) Decrypt() ([]byte, error)
- func (key *MasterKey) Encrypt(dataKey []byte) error
- func (key *MasterKey) EncryptIfNeeded(dataKey []byte) error
- func (key *MasterKey) EncryptedDataKey() []byte
- func (key *MasterKey) NeedsRotation() bool
- func (key *MasterKey) SetEncryptedDataKey(enc []byte)
- func (key MasterKey) ToMap() map[string]interface{}
- func (key *MasterKey) ToString() string
- type VaultToken
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MasterKey ¶
type MasterKey struct { KeyName string EnginePath string VaultAddress string EncryptedKey string CreationDate time.Time // contains filtered or unexported fields }
MasterKey is a Vault Transit backend path used to Encrypt and Decrypt SOPS' data key.
Adapted from https://github.com/mozilla/sops/blob/v3.7.1/hcvault/keysource.go to be able to have fine-grain control over the used decryption keys without relying on the existence of environment variable or file.
func MasterKeyFromAddress ¶
MasterKeyFromAddress creates a new MasterKey from a Vault address, Transit backend path and a key name.
func (*MasterKey) Decrypt ¶
Decrypt decrypts the EncryptedKey field with Vault Transit and returns the result.
func (*MasterKey) Encrypt ¶
Encrypt takes a SOPS data key, encrypts it with Vault Transit, and stores the result in the EncryptedKey field.
func (*MasterKey) EncryptIfNeeded ¶
EncryptIfNeeded encrypts the provided SOPS data key, if it has not been encrypted yet.
func (*MasterKey) EncryptedDataKey ¶
EncryptedDataKey returns the encrypted data key this master key holds.
func (*MasterKey) NeedsRotation ¶
NeedsRotation returns whether the data key needs to be rotated or not.
func (*MasterKey) SetEncryptedDataKey ¶
SetEncryptedDataKey sets the encrypted data key for this master key.
type VaultToken ¶
type VaultToken string
VaultToken used for authenticating towards a Vault server.
func (VaultToken) ApplyToMasterKey ¶
func (t VaultToken) ApplyToMasterKey(key *MasterKey)
ApplyToMasterKey configures the token on the provided key.