Function sgx_tkey_exchange::rsgx_ra_init_ex[][src]

pub fn rsgx_ra_init_ex(
    p_pub_key: &sgx_ec256_public_t,
    b_pse: i32,
    derive_key_cb: sgx_ra_derive_secret_keys_t
) -> SgxResult<sgx_ra_context_t>

The rsgx_ra_init_ex function creates a context for the remote attestation and key exchange process while it allows the use of a custom defined Key Derivation Function (KDF).

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.

derive_key_cb

This a pointer to a call back routine matching the funtion prototype of sgx_ra_derive_secret_keys_t. This function takes the Diffie-Hellman shared secret as input to allow the ISV enclave to generate their own derived shared keys (SMK, SK, MK and VK).

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.