Skip to main content
POST
/
tdx_quote
TDX Quote
curl --request POST \
  --url https://api.example.com/tdx_quote
{
  "success": true,
  "quote": {},
  "tcb_info": {},
  "timestamp": "<string>",
  "quote_type": "<string>",
  "error": "<string>"
}

Get TDX Quote

Generate an Intel TDX attestation quote with custom report data. This endpoint implements TLS channel binding using EKM (Exported Keying Material) as defined in RFC 5705.

Endpoint

POST /tdx_quote

Authentication

Requires X-TLS-EKM-Channel-Binding header with HMAC-signed EKM value.
The EKM header format is {ekm_hex}:{hmac_hex} where:
  • ekm_hex: 64-character hex string (32 bytes) of the TLS Exported Keying Material
  • hmac_hex: 64-character HMAC-SHA256 signature of the EKM value
The HMAC is computed as: HMAC-SHA256(ekm_hex, EKM_SHARED_SECRET)

Request Parameters

nonce_hex
string
required
64-character hexadecimal string (32 bytes). Provides freshness to the attestation quote. Must be a valid hex string.

Request Body

{
  "nonce_hex": "a1b2c3d4e5f6789012345678901234567890abcdef1234567890abcdef123456"
}

Response

success
boolean
required
Whether the quote generation succeeded
quote
GetQuoteResponse
required
TDX quote object from dstack_sdk containing the raw attestation data
tcb_info
TcbInfoV05x
required
Trusted Computing Base (TCB) information for quote verification
timestamp
string
required
Unix timestamp (in seconds) when the quote was generated
quote_type
string
required
Type of quote generated (always “tdx” for Intel TDX)
error
string
Error message if quote generation failed

Error Responses

400 Bad Request

  • Missing or invalid nonce_hex (must be exactly 64 hex characters)
  • Missing EKM header

403 Forbidden

  • Invalid EKM header HMAC signature

500 Internal Server Error

  • Dstack client not initialized
  • Failed to obtain TDX quote or TCB info
  • EKM_SHARED_SECRET not configured

Report Data Computation

The report_data field in the TDX quote is computed as:
report_data = SHA512(nonce_hex + ekm_hex)
This binds the attestation to both:
  1. The specific nonce (freshness)
  2. The TLS session via EKM (channel binding)
Clients must verify that the same nonce and EKM were used when validating the quote.

Example

curl -X POST https://your-attestation-service.com/tdx_quote \
  -H "Content-Type: application/json" \
  -H "X-TLS-EKM-Channel-Binding: a1b2c3d4e5f6789012345678901234567890abcdef1234567890abcdef123456:8f3a2b1c4d5e6f7890123456789abcdef01234567890abcdef1234567890abcd" \
  -d '{
    "nonce_hex": "deadbeef0123456789abcdef0123456789abcdef0123456789abcdef01234567"
  }'

Success Response

{
  "success": true,
  "quote": {
    // GetQuoteResponse object from dstack_sdk
    // Contains raw TDX quote bytes and metadata
  },
  "tcb_info": {
    // TcbInfoV05x object with TCB level information
    // Used for verifying the quote
  },
  "timestamp": "1709654400",
  "quote_type": "tdx"
}

Security Considerations

EKM Channel Binding: The EKM header must be forwarded by a TLS-terminating proxy (e.g., Nginx) running inside the same TEE as the attestation service. The proxy and service must share the EKM_SHARED_SECRET to prevent header forgery.
Development Mode: In non-TEE environments, the service falls back to using the EKM_SHARED_SECRET environment variable. The secret must be at least 32 characters long.

Implementation Details

The service uses the dstack_sdk to interact with Intel TDX hardware. The quote generation happens asynchronously, with both the quote and TCB info fetched concurrently for optimal performance. Source: cvm/attestation-service/attestation_service.py:182-263

Build docs developers (and LLMs) love