@@ -1069,3 +1069,75 @@ impl SyncContextResponse {
10691069 Self { data : Empty { } }
10701070 }
10711071}
1072+
1073+ // -------------------------------------------- TEE API --------------------------------------------
1074+
1075+ #[ derive( Debug , Deserialize ) ]
1076+ #[ serde( rename_all = "camelCase" ) ]
1077+ pub struct TeeAttestRequest {
1078+ /// Client-provided nonce for freshness (32 bytes as hex string)
1079+ pub nonce : String ,
1080+ /// Optional application ID to include in attestation
1081+ /// If provided, the application's bytecode BlobId (hash) will be included in report_data
1082+ pub application_id : Option < ApplicationId > ,
1083+ }
1084+
1085+ impl TeeAttestRequest {
1086+ pub fn new ( nonce : String , application_id : Option < ApplicationId > ) -> Self {
1087+ Self {
1088+ nonce,
1089+ application_id,
1090+ }
1091+ }
1092+ }
1093+
1094+ #[ derive( Debug , Serialize ) ]
1095+ #[ serde( rename_all = "camelCase" ) ]
1096+ pub struct TeeInfoResponseData {
1097+ /// Cloud provider (e.g., "gcp", "azure", "unknown")
1098+ pub cloud_provider : String ,
1099+ /// OS image name (e.g., "ubuntu-2404-tdx-v20250115")
1100+ pub os_image : String ,
1101+ /// MRTD extracted from TD report (48 bytes hex)
1102+ pub mrtd : String ,
1103+ }
1104+
1105+ #[ derive( Debug , Serialize ) ]
1106+ #[ serde( rename_all = "camelCase" ) ]
1107+ pub struct TeeInfoResponse {
1108+ pub data : TeeInfoResponseData ,
1109+ }
1110+
1111+ impl TeeInfoResponse {
1112+ pub fn new ( cloud_provider : String , os_image : String , mrtd : String ) -> Self {
1113+ Self {
1114+ data : TeeInfoResponseData {
1115+ cloud_provider,
1116+ os_image,
1117+ mrtd,
1118+ } ,
1119+ }
1120+ }
1121+ }
1122+
1123+ #[ derive( Debug , Serialize ) ]
1124+ #[ serde( rename_all = "camelCase" ) ]
1125+ pub struct TeeAttestResponseData {
1126+ /// Base64-encoded TDX quote
1127+ /// The quote contains the report_data which the client must verify
1128+ pub quote_b64 : String ,
1129+ }
1130+
1131+ #[ derive( Debug , Serialize ) ]
1132+ #[ serde( rename_all = "camelCase" ) ]
1133+ pub struct TeeAttestResponse {
1134+ pub data : TeeAttestResponseData ,
1135+ }
1136+
1137+ impl TeeAttestResponse {
1138+ pub fn new ( quote_b64 : String ) -> Self {
1139+ Self {
1140+ data : TeeAttestResponseData { quote_b64 } ,
1141+ }
1142+ }
1143+ }
0 commit comments