Documentation ¶
Index ¶
- Constants
- 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
Constants ¶
const SopsAgeKeyEnv = "SOPS_AGE_KEY"
const SopsAgeKeyFileEnv = "SOPS_AGE_KEY_FILE"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MasterKey ¶
type MasterKey struct { Identity string // a Bech32-encoded private key Recipient string // a Bech32-encoded public key EncryptedKey string // a sops data key encrypted with age // contains filtered or unexported fields }
MasterKey is an age key used to encrypt and decrypt sops' data key.
func MasterKeysFromRecipients ¶
MasterKeysFromRecipients takes a comma-separated list of Bech32-encoded public keys and returns a slice of new MasterKeys.
func (*MasterKey) Decrypt ¶
Decrypt decrypts the EncryptedKey field with the age identity and returns the result.
func (*MasterKey) Encrypt ¶
Encrypt takes a sops data key, encrypts it with age and stores the result in the EncryptedKey field.
func (*MasterKey) EncryptIfNeeded ¶
EncryptIfNeeded encrypts the provided sops' data key and encrypts it if it hasn't 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.