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

Method EncryptIfNeeded

gcpkms/keysource.go:211–216  ·  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

209// EncryptIfNeeded encrypts the provided SOPS data key, if it has not been
210// encrypted yet.
211func (key *MasterKey) EncryptIfNeeded(dataKey []byte) error {
212 if key.EncryptedKey == "" {
213 return key.Encrypt(dataKey)
214 }
215 return nil
216}
217
218// Decrypt decrypts the EncryptedKey field with GCP KMS and returns
219// the result.

Callers 1

Calls 1

EncryptMethod · 0.95

Tested by 1