Canonical summary bytes: magic + deterministic encoding.
(&self)
| 150 | |
| 151 | /// Canonical summary bytes: magic + deterministic encoding. |
| 152 | pub fn canonical_summary_bytes(&self) -> Result<Vec<u8>, BindingAttestationError> { |
| 153 | let encoded = postcard::to_allocvec(self) |
| 154 | .map_err(|error| BindingAttestationError::Encode(error.to_string()))?; |
| 155 | let mut bytes = Vec::with_capacity(ATTESTATION_SUMMARY_MAGIC.len() + encoded.len()); |
| 156 | bytes.extend_from_slice(ATTESTATION_SUMMARY_MAGIC); |
| 157 | bytes.extend_from_slice(&encoded); |
| 158 | Ok(bytes) |
| 159 | } |
| 160 | } |
| 161 | |
| 162 | /// A separately signed attestation summary (magic || summary || signature). |