Function sgx_tkey_exchange::rsgx_ra_get_keys[][src]

pub fn rsgx_ra_get_keys(
    context: sgx_ra_context_t,
    keytype: sgx_ra_key_type_t
) -> SgxResult<sgx_ra_key_128_t>

The sgx_ra_get_keys function is used to get the negotiated keys of a remote attestation and key exchange session.

This function should only be called after the service provider accepts the remote attestation and key exchange protocol message 3 produced by sgx_ra_proc_msg2.

Description

After a successful key exchange process, this API can be used in the enclave to get specific key associated with this remote attestation and key exchange session.

Parameters

context

Context returned by rsgx_ra_init.

keytype

The type of the keys, which can be SGX_RA_KEY_MK, SGX_RA_KEY_SK, or SGX_RA_VK.

Requirements

Header: sgx_tkey_exchange.edl

Library: libsgx_tkey_exchange.a

Return value

The key returned.

Errors

SGX_ERROR_INVALID_PARAMETER

Indicates an error that the input parameters are invalid.

SGX_ERROR_INVALID_STATE

Indicates this API is invoked in incorrect order, it can be called only after a success session has been established. In other words, sgx_ra_proc_msg2 should have been called and no error returned.