(key *GcpKmsKey, plaintext []byte)
| 40 | } |
| 41 | |
| 42 | func (ks *Server) encryptWithGcpKms(key *GcpKmsKey, plaintext []byte) ([]byte, error) { |
| 43 | gcpKmsKey := gcpkms.MasterKey{ |
| 44 | ResourceID: key.ResourceId, |
| 45 | } |
| 46 | err := gcpKmsKey.Encrypt(plaintext) |
| 47 | if err != nil { |
| 48 | return nil, err |
| 49 | } |
| 50 | return []byte(gcpKmsKey.EncryptedKey), nil |
| 51 | } |
| 52 | |
| 53 | func (ks *Server) encryptWithAzureKeyVault(key *AzureKeyVaultKey, plaintext []byte) ([]byte, error) { |
| 54 | azkvKey := azkv.MasterKey{ |