Safeheron-SGX-Native-Development-Framework v1.2.0
Loading...
Searching...
No Matches
ssgx::attestation_t::RemoteAttestor Class Reference

The class for Intel DCAP remote attestation. More...

#include <ssgx_attestation_t.h>

Public Member Functions

 RemoteAttestor ()
 
bool CreateReport (const uint8_t user_data[64], std::string &report)
 Generate a remote attestation report.
 
bool VerifyReport (const uint8_t user_data[64], const std::string &report, std::string &enclave_id)
 Verify a remote attestation report within a Trusted Execution Environment.
 
bool CreateReport (const std::string &user_info, std::string &report)
 Generate a remote attestation report.
 
bool VerifyReport (const std::string &user_info, const std::string &report, std::string &enclave_id)
 Verify a remote attestation report within a Trusted Execution Environment.
 
bool CreateReport (const std::string &user_info, uint64_t timestamp, std::string &report)
 Generate a remote attestation report.
 
bool VerifyReport (const std::string &user_info, uint64_t timestamp, uint64_t validity_seconds, const std::string &report, std::string &enclave_id)
 Verify a remote attestation report within a Trusted Execution Environment.
 
ErrorCode GetLastErrorCode () const
 Get the last error code.
 
std::string GetLastErrorMsg () const
 Get the last error message.
 

Detailed Description

The class for Intel DCAP remote attestation.

This class provides APIs to Create reports and Verify reports for Intel SGX Enclave applications

Constructor & Destructor Documentation

◆ RemoteAttestor()

ssgx::attestation_t::RemoteAttestor::RemoteAttestor ( )
inline

Member Function Documentation

◆ CreateReport() [1/3]

bool ssgx::attestation_t::RemoteAttestor::CreateReport ( const std::string & user_info,
std::string & report )

Generate a remote attestation report.

Parameters
[in]user_infoUser-defined data of unrestricted length, whose SHA-256 hash will be included in the remote attestation report.
[out]reportremote attestation report
Returns
Return true if successful; otherwise, return false

◆ CreateReport() [2/3]

bool ssgx::attestation_t::RemoteAttestor::CreateReport ( const std::string & user_info,
uint64_t timestamp,
std::string & report )

Generate a remote attestation report.

Parameters
[in]user_infoUser-defined data of unrestricted length, concatenated with timestamp, will have its SHA-256 hash included in the remote attestation report.
[in]timestampThe current timestamp, concatenated with user-defined data, will have its SHA-256 hash included in the remote attestation report.
[out]reportremote attestation report
Returns
Return true if successful; otherwise, return false

◆ CreateReport() [3/3]

bool ssgx::attestation_t::RemoteAttestor::CreateReport ( const uint8_t user_data[64],
std::string & report )

Generate a remote attestation report.

Parameters
[in]user_dataUser-defined data, totaling 64 bytes, will be included in the remote attestation report.
[out]reportremote attestation report
Returns
Return true if successful; otherwise, return false

◆ GetLastErrorCode()

ErrorCode ssgx::attestation_t::RemoteAttestor::GetLastErrorCode ( ) const
inline

Get the last error code.

Returns
an error code

◆ GetLastErrorMsg()

std::string ssgx::attestation_t::RemoteAttestor::GetLastErrorMsg ( ) const
inline

Get the last error message.

Returns
an error message

◆ VerifyReport() [1/3]

bool ssgx::attestation_t::RemoteAttestor::VerifyReport ( const std::string & user_info,
const std::string & report,
std::string & enclave_id )

Verify a remote attestation report within a Trusted Execution Environment.

Parameters
[in]user_infoUser-defined data utilized in the generation of a remote attestation report.
[in]reportremote attestation report
[out]enclave_idMRENCLAVE in the remote attestation report.
Returns
Return true if successful; otherwise, return false

◆ VerifyReport() [2/3]

bool ssgx::attestation_t::RemoteAttestor::VerifyReport ( const std::string & user_info,
uint64_t timestamp,
uint64_t validity_seconds,
const std::string & report,
std::string & enclave_id )

Verify a remote attestation report within a Trusted Execution Environment.

Parameters
[in]user_infoUser-defined data utilized in the generation of a remote attestation report.
[in]timestampTimestamp used in the generation of a remote attestation report.
[in]validity_secondsIf timestamp + validity_seconds < current_timestamp, the remote attestation report and User-defined data are considered expired.
[in]reportremote attestation report
[out]enclave_idMRENCLAVE in the remote attestation report.
Returns
Return true if successful; otherwise, return false

◆ VerifyReport() [3/3]

bool ssgx::attestation_t::RemoteAttestor::VerifyReport ( const uint8_t user_data[64],
const std::string & report,
std::string & enclave_id )

Verify a remote attestation report within a Trusted Execution Environment.

Parameters
[in]user_dataUser-defined data utilized in the generation of a remote attestation report.
[in]reportremote attestation report
[out]enclave_idMRENCLAVE in the remote attestation report.
Returns
Return true if successful; otherwise, return false

The documentation for this class was generated from the following file: