(key *HckmsKey, ciphertext []byte)
| 135 | } |
| 136 | |
| 137 | func (ks *Server) decryptWithHckms(key *HckmsKey, ciphertext []byte) ([]byte, error) { |
| 138 | hckmsKey, err := hckms.NewMasterKey(key.KeyId) |
| 139 | if err != nil { |
| 140 | return nil, err |
| 141 | } |
| 142 | hckmsKey.EncryptedKey = string(ciphertext) |
| 143 | plaintext, err := hckmsKey.Decrypt() |
| 144 | if err != nil { |
| 145 | return nil, err |
| 146 | } |
| 147 | return plaintext, nil |
| 148 | } |
| 149 | |
| 150 | func (ks *Server) decryptWithVault(key *VaultKey, ciphertext []byte) ([]byte, error) { |
| 151 | vaultKey := hcvault.MasterKey{ |
no test coverage detected