#[no_mangle]
pub unsafe extern "C" fn teaclave_connect_authentication_service(
    address: *const c_char,
    enclave_info_path: *const c_char,
    as_root_ca_cert_path: *const c_char
) -> *mut AuthenticationClient
Expand description

Connect to Teaclave Authentication Service.

This function connects and establishes trusted channel to the remote authentication service with address. The function gets enclave info from the file located in enclave_info_path. The file in as_root_ca_cert_path will be used to verify the attestation report from the remote service.

Arguments

  • address: address of remote services, normally,it’s a domain name with port number.
  • enclave_info_path: file path of the enclave info TOML file.
  • as_root_ca_cert_path: file path of the certificate for remote attestation service.

Return

  • The function returns an opaque pointer (handle) of the service. On error, the function returns NULL.

Safety

address, enclave_info_path, as_root_ca_cert_path should be C string (null terminated).