API Specification for PCCS¶
Get PCK Certificate¶
Retrieve the X.509 SGX Provisioning Certification Key (PCK) certificate for an SGX-enabled platform at a specified TCB level.
Endpoint(s)¶
GET https://pccs-server-url:8081/sgx/certification/v3/pckcertGET https://pccs-server-url:8081/sgx/certification/v4/pckcert
Request¶
| Name | Type | Request Type |
Required | Pattern | Description |
encrypted_ppid |
String | Query | False | ^[0-9a-fA-F]{512}$ |
Base16-encoded Encrypted_PPID |
cpusvn |
String | Query | True | ^[0-9a-fA-F]{32}$ |
Base16-encoded CPUSVN value |
pcesvn |
String | Query | True | ^[0-9a-fA-F]{4}$ |
Base16-encoded PCESVN value |
pceid |
String | Query | True | ^[0-9a-fA-F]{4}$ |
Base16-encoded PCEID value |
qeid |
String | Query | True | ^[0-9a-fA-F]{32}$ |
Base16-encoded QEID value |
Table 1.
Response¶
PckCert (x-pem-file) - PEM-encoded representation of Intel® SGX PCK Certificate in case of success (200 HTTP status code)
Status codes¶
| Code | Model | Headers | Description |
| 200 | PckCert |
|
Successfully completed |
| 400 | - | - | Invalid request parameters |
| 404 | - | - | No cache data for this platform |
| 461 | - | - | The platform was not found in the cache. |
| 462 | - | - | Certificates are not available for certain TCBs. |
| 500 | - | - | Internal server error occurred |
| 502 | - | - | Unable to retrieve the collateral from the PCS. |
Table 2.
Process¶
- Checks request parameters upon client request and returns the 400 error if any parameter is invalid.
- Gets the platform object from
platformstable with the input{qeid, pceid}as key (see platformsDao.getPlatform). - If the platform was found, which means the platform was already cached:
- Queries PCK Certificate for this platform and PCK Certificate issuer chain from cache db with the input
{qeid, cpusvn, pcesvn, pceid}as key (see pckcertDao.getCert). - Goes to step 4.
- Queries PCK Certificate for this platform and PCK Certificate issuer chain from cache db with the input
- If collateral was not retrieved in step 3:
- If platform is not cached
- If cache fill mode is
LAZY:- Gets all PCK Certificates for this platform from PCS v4 API with
{encrypted_ppid, pceid}for single-package platform, or{platform_manifest, pceid}for multi-package platform. - Parses the first cert (X.509) in the array to get FMSPC and ca type (
processororplatform). - Contacts PCS again to get SGX TCB Info as well as TDX TCB Info (if available) with the above FMSPC value.
- Gets the best cert with PCKCertSelectionTool using
{cpusvn, pcesvn, pceid, SGX TCB Info, PCK Certificates}. - Updates the cache tables:
platformstable: calls platformsDao.upsertPlatform to update the platforms table;pck_certtable: first calls pckcertDao.deleteCerts to delete old records associated with the{qeid, pceid}, then for each certificate fetched in i., calls pckcertDao.upsertPckCert to insert the certificate;platform_tcbstable: for the new raw TCB in the request and all old cached raw TCBs, inserts/updates the new TCB mapping by calling platformTcbsDao.upsertPlatformTcbs;fmspc_tcbstable: calls fmspcTcbDao.upsertFmspcTcb to updatefmspc_tcbstable for both SGX TCB Info and TDX TCB Info (if available);pck_certchaintable: calls pckCertchainDao.upsertPckCertchain to updatepck_certchaintable with the ca type in step ii.;pcs_certificatestable: calls pcsCertificatesDao.upsertPckCertificateIssuerChain to update PCK Certificate issuer chain with the ca type in step ii.
- Returns the PCK Certificate in the response body and PCK Certificate issuer chain in the response header.
- Responds with the 200 status code.
- Else return 461 (not found) error
- Gets all PCK Certificates for this platform from PCS v4 API with
- Else
- Gets PCK Certificates from cache DB with
{qeid, pceid}(see pckcertDao.getCerts). - Gets TCB Info from cache DB with the FMSPC of the platform (see fmspcTcbDao.getTcbInfo).
- Runs PCK Certificate selection tool with the raw TCB, PCK Certificates, and SGX TCB Info.
- Gets PCK Certificate issuer chain from cache DB (see pckCertchainDao.getPckCertChain).
- If success, returns the "best" certificate and certificate chain, else returns the 404 error.
- Updates
platform_tcbstable for this raw TCB (see platformTcbsDao.upsertPlatformTcbs).
- Gets PCK Certificates from cache DB with
- If cache fill mode is
- Else
- Returns the PCK Certificate in the response body and PCK Certificate issuer chain in the response header.
- If platform is not cached
Get PCK Certificate CRL¶
Retrieve the X.509 Certificate Revocation List with the revoked Intel® SGX PCK Certificates. The CRL is issued either by Intel® SGX Platform CA or by Intel® SGX Processor CA.
Endpoint(s)¶
GET https://pccs-server-url:8081/sgx/certification/v3/pckcrlGET https://pccs-server-url:8081/sgx/certification/v4/pckcrl
Request¶
| Name | Type | Request Type |
Required | Pattern | Description |
ca |
String | Query | True | Enum: processor, platform |
Identifier of the CA that issued the requested CRL |
encoding |
String | Query | True | Enum: der |
Optional identifier of the encoding for the requested CRL. If the parameter is not provided, HEX-encoded DER is assumed. If der is provided, raw DER format CRL will be returned. |
Table 3.
Response¶
PckCrl (PKIX-CRL) – DER or HEX-encoded DER representation of SGX Platform CA CRL or SGX Processor CA CRL in case of success.
Status codes¶
| Code | Model | Headers | Description |
| 200 | PckCrl |
SGX-PCK-CRL-Issuer-Chain: Issuer Certificate chain for SGX PCK CRL. It consists of SGX Intermediate CA Certificate (Processor CA) followed by SGX Root CA Certificate |
Successfully completed |
| 400 | - | - | Invalid request parameters |
| 404 | - | - | PCK CRL cannot be found |
| 500 | - | - | Internal server error occurred |
| 502 | - | - | Unable to retrieve the collateral from the PCS. |
Table 4.
Process¶
- Checks request parameters and returns the 400 error if any input parameter is invalid
- Queries PCK CRL along with CRL issuer chain with the key
{ca}(see pckcrlDao.GetPckCrl).- If record exists:
- Returns
pck_crlin the response body and the PCK CRL certificate chain in the response header. - Responds with the 200 status code.
- Returns
- Else:
- If cache fill mode is not
LAZY, returns the 404 (No cache data) error to client. - If cache fill mode is
LAZY- Gets PCK CRL and PCK CRL certificate chain from PCS v4 API with
{ca}. If failed, returns the 404 error. - Updates
pck_crlandpcs_certificatestable:- Calls pckcrlDao.upsertPckCrl(ca, crl), crl is a response body.
- Calls pcsCertificatesDao.upsertPckCrlCertchain with
{ca}and retrieved PCK CRL certificate chain.
- Returns PCK CRL in the response body and PCK CRL certificate chain in the response header.
- Responds with the 200 status code.
- Gets PCK CRL and PCK CRL certificate chain from PCS v4 API with
- If cache fill mode is not
- If record exists:
Get TCB Info¶
Retrieve Intel® SGX or TDX TCB Information for the given FMSPC
Endpoint(s)¶
GET https://pccs-server-url:8081/sgx/certification/v3/tcbGET https://pccs-server-url:8081/sgx/certification/v4/tcbGET https://pccs-server-url:8081/tdx/certification/v4/tcb
Request¶
| Name | Type | Request Type |
Required | Pattern | Description |
fmspc |
String | Query | True | ^[0-9a-fA-F]{12} |
Base16-encoded FMSPC value |
update |
String | Query | False | Enum: early, standard |
Type of update to TCB Info. If not provided standard is assumed.early indicates an early access to updated TCB Info provided as part of a TCB recovery event (commonly the day of public disclosure of the items in scope)standard indicates standard access to updated TCB Info provided as part of a TCB recovery event (commonly approximately 6 weeks after public disclosure of the items in scope) |
Table 5.
Response¶
TcbInfo (JSON) - Intel® SGX TCB Info encoded as JSON string in case of success
Status codes¶
| Code | Model | Headers | Description |
| 200 | TcbInfo |
SGX-TCB-Info-Issuer-Chain (v3) or TCB-Info-Issuer-Chain (v4): Issuer Certificate chain for Intel® SGX TCB Info. It consists of Intel® TCB Signing Certificate followed by Root CA Certificate |
Successfully completed |
| 400 | - | - | Invalid request parameters |
| 404 | - | - | TCB Information for provided {fmspc} cannot be found |
| 500 | - | - | Internal server error occurred |
| 502 | - | - | Unable to retrieve the collateral from the PCS |
Table 6.
Process¶
- Checks request parameters and returns the 400 error if any parameter is invalid.
- Queries TCB Info along with Intel® TCB Info issuer chain with key
{type, fmspc, version, update_type}(see fmspcTcbDao. getTcbInfo). Type can be 0:SGX or 1:TDX.- If record exists:
- Returns
tcb_infoin the response body and the issuer chain in the response header. - Responds with the 200 status code.
- Returns
- Else:
- If cache fill mode is not
LAZY, returns the 404 (No cache data) error to client. - If cache fill mode is
LAZY-
Gets TCB Info from PCS with
{type, fmspc, version}. If failed, return the 404 error.If type is 0:SGX, send request to /sgx/ url, else if type is 1:TDX, send request to /tdx/ url. Version will be translated to either /v3/ or /v4/. 2. Updates
fmspc_tcbsandpcs_certificates: -fmspc_tcbstable: calls fmspcTcbDao.upsertFmspcTcb; -pcs_certificatestable: calls pcsCertificatesDao.upsertTcbInfoIssuerChain. 3. Returns TCB Info in the response body and TCB Info certificate chain in the response header. 4. Responds with the 200 status code.
-
- If cache fill mode is not
- If record exists:
Get Intel's QE Identity¶
Retrieve the Quote Identity information for the Quoting Enclave issued by Intel.
Endpoint(s)¶
GET https://pccs-server-url:8081/sgx/certification/v3/qe/identityGET https://pccs-server-url:8081/sgx/certification/v4/qe/identity
Request¶
| Name | Type | Request Type |
Required | Pattern | Description |
update |
String | Query | False | Enum: early, standard |
Type of update to QE Identity. If not provided standard is assumed.early indicates an early access to updated QE Identity provided as part of a TCB recovery event (commonly the day of public disclosure of the items in scope)standard indicates standard access to updated QE Identity provided as part of a TCB recovery event (commonly approximately 6 weeks after public disclosure of the items in scope) |
Table 7.
Response¶
QEIdentity (JSON) - QE Identity data structure encoded as JSON string in case of success
Status codes¶
| Code | Model | Headers | Description |
| 200 | QEIdentity |
SGX-Enclave-Identity-Issuer-Chain: Issuer Certificate chain for Intel® SGX QE Identity. It consists of Intel® SGX TCB Signing Certificate followed by Intel® SGX Root CA Certificate |
Successfully completed |
| 404 | - | - | QE identity information cannot be found |
| 500 | - | - | Internal server error occurred |
| 502 | - | - | Unable to retrieve the collateral from the PCS |
Table 8.
Process¶
- Queries QE identity along with SGX Enclave identity issuer chain (see identityDao.
getIdentity).
- If record exists:
- Returns
qe_identityin the response body and the QE certificate chain in the response header. - Returns the 200 status code.
- Returns
- Else:
- If cache fill mode is not
LAZY, returns the 404 (No cache data) error to client. - If cache fill mode is
LAZY:- Gets QE identity from the corresponding API version of PCS. If failed, returns the 404 error.
- Updates
identitiesandpcs_certificatestable:identitiestable: calls identityDao.upsertIdentity.pcs_certificatestable: calls pcsCertificatesDao.upsertIdentityIssuerChain.
- Returns
qe_identityin the response body and the QE certificate chain in the response header. - Returns the 200 status code.
- If cache fill mode is not
- If record exists:
Get Intel's QvE Identity¶
Retrieve Identity information for Quote Verification Enclave issued by Intel.
Endpoint(s)¶
GET https://pccs-server-url:8081/sgx/certification/v3/qve/identityGET https://pccs-server-url:8081/sgx/certification/v4/qve/identity
Request¶
| Name | Type | Request Type |
Required | Pattern | Description |
update |
String | Query | False | Enum: early, standard |
Type of update to QVE Identity. If not provided standard is assumed.early indicates an early access to updated QVE Identity provided as part of a TCB recovery event (commonly the day of public disclosure of the items in scope)standard indicates standard access to updated QVE Identity provided as part of a TCB recovery event (commonly approximately 6 weeks after public disclosure of the items in scope) |
Table 9.
Response¶
QvEIdentity (JSON) - QvE Identity data structure encoded as JSON string in case of success
Status codes¶
| Code | Model | Headers | Description |
| 200 | QvEIdentity |
SGX-Enclave-Identity-Issuer-Chain: Issuer Certificate chain for Intel® SGX QvE Identity. It consists of Intel® SGX TCB Signing Certificate followed by Intel® SGX Root CA Certificate |
Successfully completed |
| 404 | - | - | QvE identity information cannot be found |
| 500 | - | - | Internal server error occurred |
| 502 | - | - | Unable to retrieve the collateral from the PCS |
Table 10.
Process¶
- Queries QvE identity along with Intel® SGX Enclave identity issuer chain (see identityDao.getEnclaveIdentity).
- If record exists:
- Returns
qve_identityin the response body and QVE certificate chain in the response header. - Returns the 200 status code.
- Returns
- Else:
- If cache fill mode is not
LAZY, returns the 404 (No cache data) error to client. - If cache fill mode is
LAZY:- Gets QvE identity from the corresponding API version of PCS . If failed, returns the 404 error.
- Updates
identitiesandpcs_certificatestable:identitiestable: calls identityDao.upsertIdentity;pcs_certificatestable: calls pcsCertificatesDao.upsertIdentityIssuerChain.
- Returns
qve_identityin the response body and QVE certificate chain in the response header. - Returns the 200 status code.
- If cache fill mode is not
- If record exists:
Get Intel's TD QE Identity¶
Retrieve Identity information for TD Quote Enclave issued by Intel.
Endpoint(s)¶
GET https://pccs-server-url:8081/tdx/certification/v4/qe/identity
Request¶
| Name | Type | Request Type |
Required | Pattern | Description |
update |
String | Query | False | Enum: early, standard |
Type of update to QE Identity. If not provided standard is assumed.early indicates an early access to updated QE Identity provided as part of a TCB recovery event (commonly the day of public disclosure of the items in scope)standard indicates standard access to updated QE Identity provided as part of a TCB recovery event (commonly approximately 6 weeks after public disclosure of the items in scope) |
Table 11.
Response¶
TDQEIdentity (JSON) - TDQE Identity data structure encoded as JSON string in case of success
Status codes¶
| Code | Model | Headers | Description |
| 200 | TDQEIdentity |
SGX-Enclave-Identity-Issuer-Chain: Issuer Certificate chain for Intel® SGX TDQE Identity. It consists of Intel® SGX TCB Signing Certificate followed by Intel® SGX Root CA Certificate |
Successfully completed |
| 404 | - | - | TDQE identity information cannot be found |
| 500 | - | - | Internal server error occurred |
| 502 | - | - | Unable to retrieve the collateral from the PCS |
Table 12.
Process¶
- Queries TDQE identity along with Intel® SGX Enclave identity issuer chain (see identityDao.getIdentity).
- If record exists:
- Returns
tdqe_identityin the response body and TDQE certificate chain in the response header. - Returns the 200 status code.
- Returns
- Else:
- If cache fill mode is not
LAZY, returns the 404 (No cache data) error to client. - If cache fill mode is
LAZY:- Gets TDQE identity from PCS v4 API. If failed, returns the 404 error.
- Updates
identitiesandpcs_certificatestable:identitiestable: calls identityDao.upsertEnclaveIdentity;pcs_certificatestable: calls pcsCertificatesDao.upsertIdentityIssuerChain.
- Returns
tdqe_identityin the response body and TDQE certificate chain in the response header. - Returns the 200 status code.
- If cache fill mode is not
- If record exists:
Get Root CA CRL¶
Retrieve Root CA CRL.
Endpoint(s)¶
GET https://pccs-server-url:8081/sgx/certification/v3/rootcacrlGET https://pccs-server-url:8081/sgx/certification/v4/rootcacrl
Request¶
No parameters
Response¶
RootCACRL – The HEX-encoded DER representation of Root CA CRL in case of success
Status codes¶
| Code | Model | Headers | Description |
| 200 | RootCACRL |
- | Successfully completed |
| 404 | - | - | Root CA CRL cannot be found |
| 500 | - | - | Internal server error occurred |
| 502 | - | - | Unable to retrieve the collateral from the PCS |
Table 13.
Process¶
- Queries root CA record(id=1) from
pcs_certificatestable (see pcsCertificatesDao.getCertificateById)- If the root CA record exists and the CRL field is not empty:
- Returns the CRL in the response body.
- Returns the 200 status code.
- Else:
- If cache fill mode is not
LAZY, return the 404 error to client - If cache fill mode is
LAZY:- Calls PCS v4 API to get QE identity and extracts the root CA from the certificate chain in response header. If failed, returns empty body.
- Parses the root CA to get cdp uri
- Contacts the cdp uri to get root CA CRL. If failed, returns the 500 error.
- Updates
pcs_certificatestable with root CA and CRL(see pcsCertificatesDao.upsertPcsCertificates) - Returns the root CA CRL in the response body (hex-encoded)
- Returns the 200 status code.
- If cache fill mode is not
- If the root CA record exists and the CRL field is not empty:
Post Platforms IDs¶
This API stores platform identity information provided in the request. This API is restricted to users with the access to the user-token.
Endpoint(s)¶
POST https://pccs-server-url:8081/sgx/certification/v3/platformsPOST https://pccs-server-url:8081/sgx/certification/v4/platforms
Request¶
Parameters¶
| Name | Type | Request Type |
Required | Pattern | Description |
user-token |
String | Header | True | String | PCCS user token which provides access to this API. |
Table 14.
Body¶
{
"qe_id": "Base16-encoded QE-ID value",
"pce_id": "Base16-encoded PCE-ID value",
"cpu_svn": "Base16-encoded CPUSVN value",
"pce_svn": "Base16-encoded PCESVN value",
"enc_ppid": "Base16-encoded PPID encrypted with PPIDEK",
"platform_manifest": "Base16-encoded platform manifest value"
}
Response¶
Status codes¶
| Code | Model | Headers | Description |
| 200 | - | - | Successfully completed (entry updated) |
| 201 | - | - | Successfully completed (entry created) |
| 400 | - | - | Invalid request parameters |
| 401 | - | - | Authentication failed |
| 500 | - | - | Internal server error occurred |
| 502 | - | - | Unable to retrieve the collateral from the PCS |
Table 15.
Process¶
- Validates the user token(calculate sha-512 hash of the token and compare the hash value with UserTokenHash in the configuration file). If validation fails, returns the 401 error.
- Validates the request body with pre-defined JSON schema. If the validation fails, returns the 400 error to client.
- Checks cache status for this platform.
- Gets the platform object from
platformstable based on the provided{qeid, pceid}(see platformsDao.getPlatform) . - If the
platform_manifestin the request does not match the one in the cache (Note: Treat the absence of theplatform_manifestin the request while there is aPLATFORM_MANIFESTin the cache as a match):- Updates
platformstable of the cache with the new manifest. - Sets cache status to FALSE.
- Updates
- Else if
platform_manifestmatches:- Queries PCK Certificate from cache db with
{qeid, cpusvn, pcesvn, pceid}to check whether PCK Certificate for this platform is cached (see pckcertDao.getCert). - If found, sets cache status to TRUE.
- Else: sets cache status to FALSE.
- Queries PCK Certificate from cache db with
- Gets the platform object from
- If cache fill mode is
OFFLINE:- If cache status is FALSE:
- Adds the platform registration data to
platforms_registeredtable and returns SUCCESS (call platformsRegDao.registerPlatform with state=NEW).
- Adds the platform registration data to
- If cache status is FALSE:
- Else:
- If cache status is FALSE:
- If cache fill mode is REQ, adds the platform registration data to
platforms_registeredtable (calls platformsRegDao.registerPlatform with state=NEW) - Uses the same logic in section Get PCK Certificate to get PCK Certificate from PCS.
- If cache fill mode is REQ, deletes the platform registration data from
platforms_registeredtable (calls platformsRegDao.registerPlatform with state=DELETED).
- If cache fill mode is REQ, adds the platform registration data to
- Checks quote verification collateral (PCK CRL, QE identity, QvE identity, Root CA CRL). If not cached, retrieves them from PCS and fills the cache
- If cache status is FALSE:
Get Platform IDs¶
Administrators use this API to retrieve the platform ID information for registered platforms or cached platforms. This API is restricted to users with the access to the admin-token.
Endpoint(s)¶
GET https://pccs-server-url:8081/sgx/certification/v3/platformsGET https://pccs-server-url:8081/sgx/certification/v4/platforms
Request¶
| Name | Type | Request Type |
Required | Pattern | Description |
admin-token |
String | Header | True | String | The administrator token required to perform the request. |
fmspc |
String | Query | False | [fmspc1,fmspc2, …] | FMSPC array. |
Table 16.
Response¶
An array of data structures defined below encoded as JSON in case of success (200 HTTP status code). When the Queue Status is 0, information for all registered platforms is retrieved.
Response format:
[
{
"qe_id": "xxxx",
"pce_id": "xxxx",
"cpu_svn": "xxxx",
"pce_svn": "xxxx",
"enc_ppid": "xxxx",
"platform_manifest": "xxxx"
},
{}
]
Empty body otherwise.
Status codes¶
| Code | Model | Headers | Description |
| 200 | See "response format" above | - | Successfully completed |
| 400 | - | - | Invalid request parameters |
| 401 | - | - | Authentication failed |
| 500 | - | - | Internal server error occurred |
Table 17.
Process¶
- Checks if request parameters include fmspc.
- If fmspc is not included (will return platforms in registration queue):
- Gets the registration platforms list from cache db (see platformsRegDao.findRegisteredPlatforms).
- If fmspc is provided ():
- The format should be [fmspc1, fmspc2, …]. If not, returns the 400 error.
- Gets cached platforms, whose fmspc is in the list (see platformsDao.getCachedPlatformsByFmspc).
- If fmspc is not included (will return platforms in registration queue):
- Returns the JSON list in response body and platforms count in response header.
Put Platform Collateral to Cache¶
Administrators use this API to push the platform collateral for collected platforms from the PCS into the caching service. This API is restricted to users with the access to the admin-token.
Endpoint(s)¶
PUT https://pccs-server-url:8081/sgx/certification/v3/platformcollateralPUT https://pccs-server-url:8081/sgx/certification/v4/platformcollateral
Request¶
Parameters¶
| Name | Type | Request Type |
Required | Pattern | Description |
Content-Type |
String | Header | True | application/json |
MIME type of the request body. |
admin-token |
String | Header | True | String | The administrator token required to perform the request. |
platform_count |
Integer | Query | True | ^[1-9][0-9]*$ |
Number of platforms in the PCK Certificate array. |
Table 18.
Body¶
A JSON object includes all the collaterals for the registered platforms.
Body format:
{
"platforms": [
{
"qe_id": "xxxx",
"pce_id": "xxxx",
"cpu_svn": "xxxx",
"pce_svn": "xxxx",
"enc_ppid": "xxxx",
"platform_manifest": "xxxx"
},
{}
],
"collaterals": {
"version": "4",
"pck_certs": [
{
"qe_id": "string",
"pce_id": "string",
"enc_ppid": "string",
"platform_manifest": "string",
"certs": []
},
{}
],
"tcbinfos": [
{
"fmspc": "string",
"sgx_tcbinfo": {},
"tdx_tcbinfo": {}
},
{}
],
"pckcacrl": "string",
"qeidentity": "string",
"tdqeidentity": "string",
"qveidentity": "string",
"certificates": {
"SGX-PCK-Certificate-Issuer-Chain": "string",
"TCB-Info-Issuer-Chain": "string",
"SGX-Enclave-Identity-Issuer-Chain": "string"
},
"rootcacrl": "string"
}
}
Response¶
Status codes¶
| Code | Model | Headers | Description |
| 200 | - | - | Successfully completed |
| 400 | - | - | Invalid request parameters |
| 401 | - | - | Authentication failed |
| 500 | - | - | Internal server error occurred |
Table 19.
Process¶
- Validates the admin token(calculate sha-512 hash of the token and compare the hash value with AdminTokenHash in the configuration file). If the validation fails, returns the 401 error to client.
- Validates the request body with pre-defined collateral schema. If the validation fails, returns the 400 error to client.
- For each platform in the list:
- Deletes old PCK Certificates for this platform (pckcertDao.deleteCerts).
- Inserts all PCK Certificates for this platform to
pck_certtable(pckcertDao.upsertPckCert). - Merges the raw TCBs in the request and cached
platform_tcbstable to get a full raw tcb list. - Extracts fmspc and ca value from any leaf cert (use the first cert for convenience).
- Finds the TCB Info for this fmspc from the TCBInfos in the request.
- For each raw TCB in the raw tcb list:
- Gets the best cert with PCKCertSelectionTool using
{cpusvn, pcesvn, pceid, TCB Info, PCK Certificates}. - Updates
platform_tcbstables.
- Gets the best cert with PCKCertSelectionTool using
- Updates
platformstable.
- For each TCB Info in the list:
- Updates
fmspc_tcbstable.
- Updates
- Updates
pck_crl,qe_identities,qve_identities,pck_certchainif present. - Updates
pcs_certificatesand root CA CRL if present.
Cache Data Refresh¶
Refresh through HTTP Request¶
This API is for maintenance only.
Refresh expired {TCB Info, PCK CRLs, QE Identity, QvE Identity, Root CA CRL} or {PCK Certificates} in cache DB.
This API is restricted to users with the access to the admin-token.
Note
This API can be used when configured for with REQ or LAZY cache fill mode.
It is not supported for OFFLINE cache fill mode.
Endpoint(s)¶
- [Deprecated]
GET https://pccs-server-url:8081/sgx/certification/v3/refresh POST https://pccs-server-url:8081/sgx/certification/v3/refreshPOST https://pccs-server-url:8081/sgx/certification/v4/refresh
Request¶
| Name | Type | Request Type |
Required | Pattern | Description |
type |
String | Query | False | certs |
Refresh type. If not provided, TCB Info, PCK CRLs, QE Identity, TDQE identity (v4 only) and QVE Identity will be refreshed. If type = certs and no fmspc is specified, all cached PCK Certificates will be refreshed. |
admin-token |
String | Header | True | String | The administrator token required to perform the request. |
fmspc |
String | Query | False | FMSPc1, FMSPC2, …, FMSPcn | Used with "type=certs". If fmspc is provided, refresh only certs for those FMSPCs. |
Table 20.
Response¶
Based on the result, returns one of the following status codes.
Status codes¶
| Code | Model | Headers | Description |
| 200 | - | - | Successfully completed |
| 401 | - | - | Operation failed |
| 500 | - | - | Internal server error occurred |
| 502 | - | - | Unable to retrieve the collateral from the PCS |
| 503 | - | - | Server is currently unable to process the request |
Table 21.
Process¶
Default (type is not specified)¶
For each record in pck_crls table, contacts PCS service to get the latest PCK CRL and PCK CRL certificate chain, then updates the pck_crls table if necessary.
For each record in fmspc_tcbs table, contacts PCS service to get the latest TCB Info, then updates the fmspc_tcbs table if necessary.
For each record in identities table, contacts PCS service to get the latest QE Identity, QvE Identity and TDQE identity (v4 only) then updates the identities table if necessary.
Refresh root CA CRL: Get the root CA from pcs_certificates table, and parse it to get the CRL cdp uri, then contacts PCS service to get the CRL and update the pcs_certificates table.
Refresh cached CRLs: Get all cached CRLs from crl_cache table, for each of them, download the CRL with the cdp_url as target url, and update the crl_cache table.
Type is certs¶
- Gets all records for all the FMSPCs in the
platform_tcbstable (see platformTcbsDao.getPlatformTcbs(fmspc)). If the FMSPCs are not provided, updates all platforms that are already cached. - Sorts the records by
{qeid, pceid}so that the TCB mapping records of the same platform are put together. -
For each platform:
- Gets all PCK Certificates for this platform from Intel SGX/TDX with
{encrypted_ppid, pceid}or{PLATFORM_MANIFEST, pceid}. - Parses the first cert (X.509) in the array to get FMSPC value.
-
Contacts PCS again to get TCB Info with the above FMSPC value.
Note: This does not update the TCB Info in the cache. The TCB Info is only used with the PCK Cert Selection library to update the
platform_tcbstable. -
Deletes old certificates and inserts new certificates for the platform.
- For each raw TCB in the list of step 2, runs the PCK Cert Selection Tool to get the best certificate and update the cache.
- Gets all PCK Certificates for this platform from Intel SGX/TDX with
Scheduled Cache Data Refresh¶
The PCCS can also be configured to refresh the cache data regularly, for example, once a day or once a week, etc. The scheduled task does not refresh PCK Certificates because the network traffic overhead is large.
This refresh method is only supported in the LAZY cache fill mode.
It supports Cron-style Scheduling:
* * * * * *
┬ ┬ ┬ ┬ ┬ ┬
│ │ │ │ │ │
│ │ │ │ │ └ day of week (0 - 7) (0 or 7 is Sun)
│ │ │ │ └───── month (1 - 12)
│ │ │ └────────── day of month (1 - 31)
│ │ └─────────────── hour (0 - 23)
│ └──────────────────── minute (0 - 59)
└───────────────────────── second (0 - 59, OPTIONAL)
Get CRL by endpoint¶
Retrieve the X.509 Certificate Revocation List by the CRL endpoint.
Endpoint(s)¶
GET https://pccs-server-url:8081/sgx/certification/v3/crlGET https://pccs-server-url:8081/sgx/certification/v4/crl
Request¶
| Name | Type | Request Type |
Required | Pattern | Description |
uri |
String | Query | True | Example: https://certificates.trustedservices.intel.com/IntelSGXRootCA.der |
URL to DER-encoded CRL (Root CA CRL, Platform/Package CA PCK CRL) |
Table 22.
Response¶
Crl - DER-encoded representation of specified CRL.
Status codes¶
| Code | Model | Headers | Description |
| 200 | Crl |
- | Successfully completed |
| 400 | - | - | Invalid request parameters |
| 500 | - | - | Internal server error occurred |
| 502 | - | - | Unable to retrieve the collateral from the PCS |
| 503 | - | - | Server is currently unable to process the request |
Table 23.
Process¶
- Checks request parameters and returns the 400 error if the input parameter is invalid
- Queries CRL with the uri as the key (see crlCacheDao.getCrl).
- If record exists:
- Returns the crl buffer.
- Responds with the 200 status code.
- Else:
- If cache fill mode is not
LAZY, returns the 404 (No cache data) error to client. - If cache fill mode is
LAZY- Download the CRL with the uri address as target. If failed, returns the 404 error.
- Updates
crl_cachetable:- Calls crlCacheDao.upsertCrl(uri, crl), crl is response body.
- Returns CRL in the response body.
- Responds with the 200 status code.
- If cache fill mode is not
- If record exists:
Get default platform policy¶
Retrieve the default platform policy provided by the platform owner.
Endpoint(s)¶
GET https://pccs-server-url:8081/sgx/certification/v3/appraisalpolicyGET https://pccs-server-url:8081/sgx/certification/v4/appraisalpolicy
Request¶
| Name | Type | Request Type |
Required | Pattern | Description |
fmspc |
String | Query | True | ^[0-9a-fA-F]{12} |
Base16-encoded FMSPC value |
Table 24.
Response¶
The default platform policy for this fmspc in jwt format.
Status codes¶
| Code | Model | Headers | Description |
| 200 | - | - | Successfully completed |
| 400 | - | - | Invalid request parameters |
| 404 | - | - | The default platform policy can't be found. |
| 500 | - | - | Internal server error occurred |
Table 25.
Process¶
- Checks request parameters and returns the 400 error if the input parameter is invalid
- Queries the policy whose default flag is true for the specified fmspc (see appraisalPolicyDao.
getDefaultAppraisalPolicies).
- If record exists:
- Returns the policy buffer.
- Responds with the 200 status code.
- Else:
- Returns the 404 error.
- If record exists:
Put appraisal policy¶
Upload an appraisal policy to the PCCS.
Endpoint(s)¶
PUT https://pccs-server-url:8081/sgx/certification/v3/appraisalpolicyPUT https://pccs-server-url:8081/sgx/certification/v4/appraisalpolicy
Request¶
Parameters¶
N/A
Body¶
{
"policy": policy string,
"is_default": default flag,
"fmspc": fmspc value
}
Response¶
Status codes¶
| Code | Model | Headers | Description |
| 200 | - | - | Successfully completed |
| 400 | - | - | Invalid request parameters |
| 401 | - | - | Authentication failed |
| 500 | - | - | Internal server error occurred |
Table 26.
Process¶
- Validates the admin token(calculate sha-512 hash of the token and compare the hash value with AdminTokenHash in the configuration file). If the validation fails, returns the 401 error to client.
- Validates the request body with pre-defined policy schema. If the validation fails, returns the 400 error to client.
- Calculate sha384 hash of the policy data, which will be used as the ID of the policy.
- Parse the policy file to get policy type based on the class id. Currently only 3 types are supported: 0 – SGX; 1 – TDX 1.0; 2 – TDX 1.5;
- Insert or update the
appraisal_policiestable (see appraisalPolicyDao).