(&self)
| 76 | } |
| 77 | |
| 78 | fn read_ciphertext_blob(&self) -> Result<String> { |
| 79 | check_key_file(&self.ciphertext_blob_path)?; |
| 80 | std::fs::read_to_string(&self.ciphertext_blob_path) |
| 81 | .map(|s| s.trim().to_owned()) |
| 82 | .map_err(|e| crate::Error::Encryption { |
| 83 | detail: format!( |
| 84 | "failed to read Vault ciphertext blob from {}: {e}", |
| 85 | self.ciphertext_blob_path.display() |
| 86 | ), |
| 87 | }) |
| 88 | } |
| 89 | |
| 90 | fn write_ciphertext_blob(&self, ciphertext: &str) -> Result<()> { |
| 91 | std::fs::write(&self.ciphertext_blob_path, ciphertext).map_err(|e| { |
no test coverage detected