Verify the summary's own signature against `key`.
(&self, key: &PublicKey)
| 250 | |
| 251 | /// Verify the summary's own signature against `key`. |
| 252 | pub fn verify_signature(&self, key: &PublicKey) -> Result<(), BindingAttestationError> { |
| 253 | let mut message = |
| 254 | Vec::with_capacity(ATTESTATION_SUMMARY_SIGN_DOMAIN.len() + self.summary_bytes.len()); |
| 255 | message.extend_from_slice(ATTESTATION_SUMMARY_SIGN_DOMAIN); |
| 256 | message.extend_from_slice(&self.summary_bytes); |
| 257 | let signature = Signature::from_bytes(self.signature); |
| 258 | signature |
| 259 | .verify(&message, key) |
| 260 | .map_err(|error| BindingAttestationError::Signature { |
| 261 | reason: error.to_string(), |
| 262 | }) |
| 263 | } |
| 264 | } |
| 265 | |
| 266 | /// Errors for the attestation summary boundary. |