[−][src]Function sgx_tkey_exchange::rsgx_ra_init
pub fn rsgx_ra_init(
p_pub_key: &sgx_ec256_public_t,
b_pse: i32
) -> SgxResult<sgx_ra_context_t>
The rsgx_ra_init function creates a context for the remote attestation and key exchange process.
Description
This is the first API user should call for a key exchange process. The context returned from this function is used as a handle for other APIs in the key exchange library.
Parameters
p_pub_key
The EC public key of the service provider based on the NIST P-256 elliptic curve.
b_pse
If true, platform service information is needed in message 3. The caller should make sure a PSE session has been established using rsgx_create_pse_session before attempting to establish a remote attestation and key exchange session involving platform service information.
Requirements
Header: sgx_tkey_exchange.edl
Library: libsgx_tkey_exchange.a
Return value
The output context for the subsequent remote attestation and key exchange process, to be used in sgx_ra_get_msg1 and sgx_ra_proc_msg2.
Errors
SGX_ERROR_INVALID_PARAMETER
Indicates an error that the input parameters are invalid.
SGX_ERROR_OUT_OF_MEMORY
Not enough memory is available to complete this operation, or contexts reach the limits.
SGX_ERROR_AE_SESSION_INVALID
The session is invalid or ended by the server.
SGX_ERROR_UNEXPECTED
Indicates that an unexpected error occurred.