| 155 | } |
| 156 | |
| 157 | pub async fn attest(&self, report_data: Vec<u8>) -> Result<AttestResponse> { |
| 158 | if report_data.is_empty() || report_data.len() > 64 { |
| 159 | anyhow::bail!("Invalid report data length") |
| 160 | } |
| 161 | let hex_data = hex_encode(report_data); |
| 162 | let data = json!({ "report_data": hex_data }); |
| 163 | let response = self.send_rpc_request("/Attest", &data).await?; |
| 164 | let response = serde_json::from_value::<AttestResponse>(response)?; |
| 165 | |
| 166 | Ok(response) |
| 167 | } |
| 168 | |
| 169 | pub async fn info(&self) -> Result<InfoResponse> { |
| 170 | let response = self.send_rpc_request("/Info", &json!({})).await?; |