(key *HckmsKey, plaintext []byte)
| 64 | } |
| 65 | |
| 66 | func (ks *Server) encryptWithHckms(key *HckmsKey, plaintext []byte) ([]byte, error) { |
| 67 | hckmsKey, err := hckms.NewMasterKey(key.KeyId) |
| 68 | if err != nil { |
| 69 | return nil, err |
| 70 | } |
| 71 | err = hckmsKey.Encrypt(plaintext) |
| 72 | if err != nil { |
| 73 | return nil, err |
| 74 | } |
| 75 | return []byte(hckmsKey.EncryptedKey), nil |
| 76 | } |
| 77 | |
| 78 | func (ks *Server) encryptWithVault(key *VaultKey, plaintext []byte) ([]byte, error) { |
| 79 | vaultKey := hcvault.MasterKey{ |
no test coverage detected