MCPcopy Index your code
hub / github.com/getsops/sops / EncryptIfNeeded

Method EncryptIfNeeded

hckms/keysource.go:176–181  ·  view source on GitHub ↗

EncryptIfNeeded encrypts the provided SOPS data key, if it has not been encrypted yet.

(dataKey []byte)

Source from the content-addressed store, hash-verified

174// EncryptIfNeeded encrypts the provided SOPS data key, if it has not been
175// encrypted yet.
176func (key *MasterKey) EncryptIfNeeded(dataKey []byte) error {
177 if key.EncryptedKey == "" {
178 return key.Encrypt(dataKey)
179 }
180 return nil
181}
182
183// EncryptedDataKey returns the encrypted data key this master key holds.
184func (key *MasterKey) EncryptedDataKey() []byte {

Callers 1

Calls 1

EncryptMethod · 0.95

Tested by 1