The software development kit (SDK) includes the following data models:
MYTFProfile
MYTFProfile is the verifiable identity of MYTF. A Profile represents the identity and status of an independent component within the trusted computing engine. This component holds its own signature key and encryption key. The signature key is used to verify the component's behavior within the trusted computing engine. The encryption key enables end-to-end encrypted communication between the component and external parties.
When an MYTF compute node is initialized, the enclave first generates a Quote that represents its own identity. This is done using the Local Attestation feature provided by Intel Software Guard Extensions (SGX). Then, using the Remote Attestation feature from Intel SGX, MYTF sends the Quote to the Intel Attestation Service (IAS). IAS verifies the identity of the trusted execution hardware where MYTF is located and the enclave code running in MYTF. The hash of the unique MYTF identity data, profileData, is included in the Quote. IAS performs an integrity check on the entire Quote.
Using the MYTF SDK, you can retrieve the MYTFProfile, which is the identity of an MYTF instance certified by IAS, from any MYTF instance. You can then verify that the MYTF instance is secure and trusted.
Parameter | Type | Description |
report | String | The correctness report from IAS that verifies the attestation information. |
xIasreportSignature | String | The signature of the report from IAS. |
xIasreportSigningCertificate | String | The IAS certificate chain. |
profileData | String | The MYTF identity information data. |
SGXReport
SGXReport is an attestation report from Intel SGX. It is a verification report from IAS for the MYTF identity and its hardware information.
Parameter | Type | Description |
id | String | The unique ID of the report. |
timestamp | timestamp | The timestamp when the report was generated. |
epidPseudonym | String | EPID-related information. |
isvEnclaveQuoteStatus | String | The status of the ISV remote attestation report. "OK" indicates that the ISV attestation is successful. |
platformInfoBlob | String | The platform information BLOB. |
isvEnclaveQuoteBody | IsvEnclaveQuoteBody | The details of the remote attestation report. |
ProfileData
ProfileData is the unique identity data of MYTF. It includes MYTFInfo (MYTF identity information) and CounterInfo (counter information). When MYTF generates a Quote, the hash of ProfileData is injected into the Quote as custom data. IAS then performs an integrity check on the Quote.
Parameter | Type | Description |
MYTFInfo | byte[] | MYTF identity information. |
CounterInfo | byte[] | Used for anti-replay protection to ensure that the MYTFInfo for each user request is unique. |
MYTFInfo
MYTFInfo contains the identity information of MYTF. MYTFProfile is the complete, IAS-verified identity of MYTF, which includes MYTFInfo and the IAS verification certificate. In MYTFInfo, Encryption Keys are the public encryption keys of MYTF, and Signing Keys are the public signing keys of MYTF. Multiple public keys are provided for different algorithms.
Parameter | Type | Description |
version | Int | The current version of MYTF. |
domainName | String | The domain name where MYTF is located. |
regionName | String | The partition name where MYTF is located. |
MREnclave | byte[] | The measurement of the MYTF instance code. |
MRSigner | byte[] | The measurement of the public key of the MYTF instance issuer. |
IASCACert | String | The root certificate of the Intel Attestation Service CA. |
property | Map< String, String> | Other additional properties. |
encryptionKeys | Map< KeyType, byte[]> | The public encryption keys of MYTF. This includes multiple public encryption keys. |
signingKeys | Map< KeyType, byte[]> | The public signing keys of MYTF. This includes multiple public signing keys. |
TAPPProfile
TAPPProfile is the verifiable identity of a TAPP. It includes TAPPInfo and the signature for TAPPInfo from MYTF.
Parameter | Type | Description |
TAPPInfo | byte[] | TAPP information. |
signature | byte[] | The signature of the TAPP information from MYTF. |
signingPK | byte[] | The public signing key of MYTF. |
TAPPInfo
TAPPInfo is the identity of a TAPP. Encryption Keys are the public encryption keys of the TAPP. Signing Keys are the public signing keys of the TAPP. Multiple public keys exist for different encryption algorithms.
Parameter | Type | Description |
tappId | String | The TAPP name. |
version | Int | The TAPP version number. |
execEngine | String | The type of execution engine. |
codeHash | byte[] | The hash of the TAPP executable bytecode. |
description | String | The TAPP description. |
property | Map< String, String> | Additional properties. |
encryptionKeys | Map< KeyType, byte[]> | The public encryption keys of the TAPP. |
signingKeys | Map< KeyType, byte[]> | The public signing keys of the TAPP. |
TAPPInstallRequest
Parameter | Type | Description |
tappId | String | The TAPP name. |
tappVersion | Int | The TAPP version number. |
tappExecEngine | ExecEngineType | The type of execution engine for the TAPP. The default is MYVM. |
bytecode | byte[] | The bytecode of the TAPP. This is the bytecode compiled by MYCDT after you write the TAPP code. |
description | String | The description of the TAPP. |
property | Map< String, String> | Additional properties of the TAPP. |
The following is an example of how to create a request to install a TAPP:
// Create a request to install a TAPP
TappInstallRequest tappInstallRequest = TappInstallRequest.builder()
.newTapp(tappId, tappVersion, bytecodes)
.setTappDescription(tappDesc)
.build();TAPPInstallResponse
Parameter | Type | Description |
isSuccess | boolean | Indicates whether the installation is successful. |
errorCode | Int | The error code. |
errorMessage | String | The error message. |
The following is an example of how to parse the response for a TAPP installation:
// Parse the response for installing a TAPP
TappInstallResponse tappInstallResponse = restClient.installTapp(tappInstallRequest);
boolean ifSuccess = tappInstallResponse.isSuccess();
int errorCode = tappInstallResponse.getErrorCode();
String errorMsg = tappInstallResponse.getErrorMessage();TAPPRemoveRequest
Parameter | Type | Description |
tappId | String | The TAPP name. |
tappVersion | int | The TAPP version number. |
The following is an example of how to create a request to delete a TAPP:
// Create a request to delete a TAPP
TappRemoveRequest tappRemoveRequest = TappRemoveRequest.builder()
.defaultRequest(tappId, tappVersion)
.build();TAPPRemoveResponse
Parameter | Type | Description |
isSuccess | boolean | Was the installation successful? |
errorCode | Int | The error code. |
errorMessage | String | The error message. |
The following is an example of how to parse the response for a TAPP deletion:
// Parse the response for deleting a TAPP
TappRemoveResponse tappRemoveResponse = restClient.removeTapp(tappRemoveRequest);
Assert.assertTrue(tappRemoveResponse.isSuccess());TAPPExecuteRequest
Parameter | Type | Description |
tappId | String | The TAPP name. |
tappVersion | Int | The TAPP version number. |
method | String | The method to execute. |
args | byte[] | The method parameters. |
The following is an example of how to create a request to execute a TAPP:
// Create a request to execute a TAPP
TappExecuteRequest tappExecuteRequest = TappExecuteRequest.builder()
.defaultRequest(tappId, tappVersion, testReqMethod)
.build();TAPPExecuteResponse
Parameter | Type | Description |
requestHash | byte[] | The hash of the execution request. |
responseCode | Int | The error code. |
responseMessage | String | The error message. |
returnValue | byte[] | The result returned from executing the code in MYVM. |
output | byte[] | The user-defined output value or the log after a failed execution. |
The following is an example of how to parse the response for a TAPP execution:
// Send the request to execute the TAPP
TappExecuteResponse tappExecuteResponse = restClient.executeTapp(tappExecuteRequest);
// Check if the trusted computing task request is valid
boolean ifReqSuccess = tappExecuteResponse.isRequestSuccess();
// Check if the trusted computing task execution is successful
boolean ifExeSuccess = tappExecuteResponse.isExecuteSuccess();
// Check if the computing task request is valid and view the error code
int responseCode = tappExecuteResponse.getResponseCode();
String responseMessage = tappExecuteResponse.getResponseMessage();
// View the user-defined output during the task execution or the error message from the compute engine after a failed execution
byte[] returnValue = tappExecuteResponse.getOutput();
// Get the execution result
byte[] returnValue = tappExecuteResponse.getReturnValue().getRawReturnValues();
// Get the TAPP signature
byte[] sig = tappExecuteResponse.getSignature();TAPPAuthorizeRequest
Parameter | Type | Description |
tappId | String | The identity of the TAPP. |
tappVersion | Int | The version of the TAPP. |
authData | UserIdentityData | The authorization data. |
The following is an example of how to create a request to authorize a TAPP:
// Create a request to authorize a TAPP
UserIdentityData authorizeeData = new UserIdentityData(UserDomainEnum.BAASREST, "user_id","", AccessTypeEnum.EXECUTE);
TappAuthorizeRequest tappAuthorizeRequest = TappAuthorizeRequest.builder()
.defaultRequest(tappId, tappVersion, authorizeeData)
.build();TAPPAuthorizeResponse
Parameter | Type | Description |
isSuccess | boolean | Success |
errorCode | Int | The error code. |
errorMessage | String | The error message. |
The following is an example of how to parse the response for a TAPP authorization:
// Parse the response for authorizing a TAPP
TappAuthorizeResponse tappAuthorizeResponse = restClient.authorizeTapp(tappAuthorizeRequest);
Assert.assertTrue(tappAuthorizeResponse.isSuccess());