intel_dcap_api/lib.rs
1// SPDX-License-Identifier: Apache-2.0
2// Copyright (c) 2025 Matter Labs
3
4//! Intel API Client
5//!
6//! This module provides an API client for interacting with the Intel API for Trusted Services.
7//! The API follows the documentation found at [Intel API Documentation](https://api.portal.trustedservices.intel.com/content/documentation.html).
8//!
9//! Create an [`ApiClient`] to interface with the Intel API.
10//!
11//! Example
12//! ```rust,no_run
13//! use intel_dcap_api::{ApiClient, IntelApiError, TcbInfoResponse};
14//!
15//! #[tokio::main]
16//! async fn main() -> Result<(), IntelApiError> {
17//! let client = ApiClient::new()?;
18//!
19//! // Example: Get SGX TCB Info
20//! let fmspc_example = "00606A000000"; // Example FMSPC from docs
21//! match client.get_sgx_tcb_info(fmspc_example, None, None).await {
22//! Ok(TcbInfoResponse {
23//! tcb_info_json,
24//! issuer_chain,
25//! }) => println!(
26//! "SGX TCB Info for {}:\n{}\nIssuer Chain: {}",
27//! fmspc_example, tcb_info_json, issuer_chain
28//! ),
29//! Err(e) => eprintln!("Error getting SGX TCB info: {}", e),
30//! }
31//!
32//! Ok(())
33//! }
34//! ```
35
36#![deny(missing_docs)]
37#![deny(clippy::all)]
38
39mod client;
40mod error;
41mod requests;
42mod responses;
43mod types;
44
45// Re-export public items
46pub use client::ApiClient;
47pub use error::IntelApiError;
48pub use responses::{
49 AddPackageResponse, EnclaveIdentityJson, EnclaveIdentityResponse, FmspcJsonResponse,
50 PckCertificateResponse, PckCertificatesResponse, PckCrlResponse, TcbEvaluationDataNumbersJson,
51 TcbEvaluationDataNumbersResponse, TcbInfoJson, TcbInfoResponse,
52};
53pub use types::{ApiVersion, CaType, CrlEncoding, PlatformFilter, UpdateType};