MCPcopy
hub / github.com/getsops/sops / EncryptIfNeeded

Method EncryptIfNeeded

kms/keysource.go:292–297  ·  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

290// EncryptIfNeeded encrypts the provided SOPS data key, if it has not been
291// encrypted yet.
292func (key *MasterKey) EncryptIfNeeded(dataKey []byte) error {
293 if key.EncryptedKey == "" {
294 return key.Encrypt(dataKey)
295 }
296 return nil
297}
298
299// EncryptedDataKey returns the encrypted data key this master key holds.
300func (key *MasterKey) EncryptedDataKey() []byte {

Callers

nothing calls this directly

Calls 1

EncryptMethod · 0.95

Tested by

no test coverage detected