Overview
This example shows how certificates can be used for authenticating other parties.
In em-app/examples/ there are 2 folders:
server
- holds an example that listens on a hardcoded address.client
- holds an example that connects to the hardcoded address.
Both applications use a hardcoded certificate authority public key for peer verifications. This is obtained through the './register_and_run.sh' script from the account where they are added. This can be done manually as well.
The register_and_run.sh
script above is only meant as an example and the script automates the following steps:
Building the SGX application
Registering the EDP application with Fortanix Confidential Computing Manager (CCM), and
Running the EDP application
To do the above steps manually, refer to the article Bringing EDP RUST Apps to Fortanix Confidential Computing Manager.
Example for Good Weather Usage
Server-side operations
Update
./config
file in https://github.com/fortanix/rust-sgx/tree/master/em-app/examples/server folder with credentials, the desired account, and application names.Run
./register_and_run.sh'
script which automates the steps for building the SGX application/Registering the EDP application with Fortanix CCM, and Running the EDP application.Logs:
Client-Side Operations
Update
./config
file in https://github.com/fortanix/rust-sgx/tree/master/em-app/examples/client folder with credentials, the desired account, and application names.Run
'./register_and_run.sh'
script which automates the steps for building the SGX application/Registering the EDP application with Fortanix CCM, and Running the EDP application.Logs:
Example for Bad Actor Server
A properly configured client attempts to connect to a server that does not have a certificate signed by the expected CA:
Client sees an error:
Full Log:
Example for Bad Actor Client
A client with a certificate that is not issued by a proper Fortanix CCM account will result in server error:
Full Log: