Crate intel_dcap_api

Source
Expand description

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.

Create an ApiClient to interface with the Intel API.

Example

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(())
}

Structs§

AddPackageResponse
Response structure for the request to add a package.
ApiClient
Client for interacting with Intel Trusted Services API.
EnclaveIdentityResponse
Response structure for Enclave Identity Information.
PckCertificateResponse
Response structure for a PCK (Platform Configuration Key) Certificate.
PckCertificatesResponse
Response structure for multiple PCK (Platform Configuration Key) Certificates.
PckCrlResponse
Response structure for Platform Configuration Key Certificate Revocation List (PCK CRL).
TcbEvaluationDataNumbersResponse
Response structure for TCB Evaluation Data Numbers (V4 ONLY).
TcbInfoResponse
Response structure for TCB (Trusted Computing Base) Information.

Enums§

ApiVersion
Represents the version of the Intel Trusted Services API to target.
CaType
Represents the type of Certificate Authority (CA) for Intel Trusted Services.
CrlEncoding
Represents the encoding format for Certificate Revocation Lists (CRLs).
IntelApiError
Represents all possible errors that can occur when interacting with Intel’s DCAP API.
PlatformFilter
Represents the platform filter options for Intel DCAP (Data Center Attestation Primitives) API.
UpdateType
Represents the type of update for Intel Trusted Services.

Type Aliases§

EnclaveIdentityJson
JSON structure as defined in Appendix B of the API spec. Content may vary slightly between API v3 and v4.
FmspcJsonResponse
JSON Array of {fmspc, platform}. Content structure expected to be consistent between v3 and v4.
TcbEvaluationDataNumbersJson
JSON structure as defined in Appendix C of the API spec (V4 ONLY).
TcbInfoJson
JSON structure as defined in Appendix A of the API spec. Content may vary slightly between API v3 and v4.