(key *KmsKey, plaintext []byte)
| 31 | } |
| 32 | |
| 33 | func (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 | |
| 42 | func (ks *Server) encryptWithGcpKms(key *GcpKmsKey, plaintext []byte) ([]byte, error) { |
| 43 | gcpKmsKey := gcpkms.MasterKey{ |
no test coverage detected