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

Method encryptWithKms

keyservice/server.go:33–40  ·  view source on GitHub ↗
(key *KmsKey, plaintext []byte)

Source from the content-addressed store, hash-verified

31}
32
33func (ks *Server) encryptWithKms(key *KmsKey, plaintext []byte) ([]byte, error) {
34 kmsKey := kmsKeyToMasterKey(key)
35 err := kmsKey.Encrypt(plaintext)
36 if err != nil {
37 return nil, err
38 }
39 return []byte(kmsKey.EncryptedKey), nil
40}
41
42func (ks *Server) encryptWithGcpKms(key *GcpKmsKey, plaintext []byte) ([]byte, error) {
43 gcpKmsKey := gcpkms.MasterKey{

Callers 1

EncryptMethod · 0.95

Calls 2

kmsKeyToMasterKeyFunction · 0.85
EncryptMethod · 0.65

Tested by

no test coverage detected