Request a versioned attestation for the provided report data.
(
self,
report_data: str | bytes,
)
| 425 | return GetQuoteResponse(**result) |
| 426 | |
| 427 | async def attest( |
| 428 | self, |
| 429 | report_data: str | bytes, |
| 430 | ) -> AttestResponse: |
| 431 | """Request a versioned attestation for the provided report data.""" |
| 432 | if not report_data or not isinstance(report_data, (bytes, str)): |
| 433 | raise ValueError("report_data can not be empty") |
| 434 | report_bytes: bytes = ( |
| 435 | report_data.encode() if isinstance(report_data, str) else report_data |
| 436 | ) |
| 437 | if len(report_bytes) > 64: |
| 438 | raise ValueError("report_data must be less than 64 bytes") |
| 439 | hex = binascii.hexlify(report_bytes).decode() |
| 440 | result = await self._send_rpc_request("Attest", {"report_data": hex}) |
| 441 | return AttestResponse(**result) |
| 442 | |
| 443 | async def info(self) -> InfoResponse[TcbInfo]: |
| 444 | """Fetch service information including parsed TCB info.""" |