mirror of
https://github.com/matter-labs/teepot.git
synced 2025-07-22 23:44:48 +02:00
feat(api): add Intel DCAP API client module
Introduced a new `intel-dcap-api` crate for interacting with Intel's DCAP APIs. - Implemented various API client functionalities for SGX/TDX attestation services. - Added support for registration, certification, enclave identity, and FMSPC retrieval. Signed-off-by: Harald Hoyer <harald@matterlabs.dev>
This commit is contained in:
parent
93c35dad38
commit
ed84a424db
11 changed files with 1939 additions and 1 deletions
53
crates/intel-dcap-api/src/lib.rs
Normal file
53
crates/intel-dcap-api/src/lib.rs
Normal file
|
@ -0,0 +1,53 @@
|
|||
// SPDX-License-Identifier: Apache-2.0
|
||||
// Copyright (c) 2025 Matter Labs
|
||||
|
||||
//! Intel API Client
|
||||
//!
|
||||
//! This module provides an API client for interacting with the Intel API for Trusted Services.
|
||||
//! The API follows the documentation found at [Intel API Documentation](https://api.portal.trustedservices.intel.com/content/documentation.html).
|
||||
//!
|
||||
//! Create an [`ApiClient`] to interface with the Intel API.
|
||||
//!
|
||||
//! Example
|
||||
//! ```rust,no_run
|
||||
//! use intel_dcap_api::{ApiClient, IntelApiError, TcbInfoResponse};
|
||||
//!
|
||||
//! #[tokio::main]
|
||||
//! async fn main() -> Result<(), IntelApiError> {
|
||||
//! let client = ApiClient::new()?;
|
||||
//!
|
||||
//! // Example: Get SGX TCB Info
|
||||
//! let fmspc_example = "00606A000000"; // Example FMSPC from docs
|
||||
//! match client.get_sgx_tcb_info(fmspc_example, None, None).await {
|
||||
//! Ok(TcbInfoResponse {
|
||||
//! tcb_info_json,
|
||||
//! issuer_chain,
|
||||
//! }) => println!(
|
||||
//! "SGX TCB Info for {}:\n{}\nIssuer Chain: {}",
|
||||
//! fmspc_example, tcb_info_json, issuer_chain
|
||||
//! ),
|
||||
//! Err(e) => eprintln!("Error getting SGX TCB info: {}", e),
|
||||
//! }
|
||||
//!
|
||||
//! Ok(())
|
||||
//! }
|
||||
//! ```
|
||||
|
||||
#![deny(missing_docs)]
|
||||
#![deny(clippy::all)]
|
||||
|
||||
mod client;
|
||||
mod error;
|
||||
mod requests;
|
||||
mod responses;
|
||||
mod types;
|
||||
|
||||
// Re-export public items
|
||||
pub use client::ApiClient;
|
||||
pub use error::IntelApiError;
|
||||
pub use responses::{
|
||||
AddPackageResponse, EnclaveIdentityJson, EnclaveIdentityResponse, FmspcJsonResponse,
|
||||
PckCertificateResponse, PckCertificatesResponse, PckCrlResponse, TcbEvaluationDataNumbersJson,
|
||||
TcbEvaluationDataNumbersResponse, TcbInfoJson, TcbInfoResponse,
|
||||
};
|
||||
pub use types::{ApiVersion, CaType, CrlEncoding, PlatformFilter, UpdateType};
|
Loading…
Add table
Add a link
Reference in a new issue