Compute expected TDX measurements for a given VM configuration. This method downloads the OS image if needed (using the configured cache), then computes the expected MRTD and RTMRs based on the VM configuration. Results are cached automatically.
(
&self,
vm_config: &VmConfig,
)
| 383 | /// then computes the expected MRTD and RTMRs based on the VM configuration. |
| 384 | /// Results are cached automatically. |
| 385 | pub async fn compute_measurements_for_config( |
| 386 | &self, |
| 387 | vm_config: &VmConfig, |
| 388 | ) -> Result<TdxMeasurements> { |
| 389 | let image_paths = self.ensure_image_downloaded(vm_config).await?; |
| 390 | |
| 391 | self.load_or_compute_measurements( |
| 392 | vm_config, |
| 393 | &image_paths.fw_path, |
| 394 | &image_paths.kernel_path, |
| 395 | &image_paths.initrd_path, |
| 396 | &image_paths.kernel_cmdline, |
| 397 | ) |
| 398 | } |
| 399 | |
| 400 | pub async fn verify(&self, request: VerificationRequest) -> Result<VerificationResponse> { |
| 401 | let attestation = if let Some(attestation) = &request.attestation { |
no test coverage detected