Write an attestation to a writer (e.g., a file).
(&self, writer: &mut W)
| 248 | |
| 249 | /// Write an attestation to a writer (e.g., a file). |
| 250 | pub fn write_to<W: Write>(&self, writer: &mut W) -> Result<Hash, AttestationError> { |
| 251 | let data = self.serialize()?; |
| 252 | let hash = Hash::of(&data); |
| 253 | writer.write_all(&data).map_err(AttestationError::Io)?; |
| 254 | Ok(hash) |
| 255 | } |
| 256 | |
| 257 | /// Check whether a byte slice looks like an attestation file. |
| 258 | /// |
no test coverage detected