To build an SGX application for our minimal KMS, we will be using OpenEnclave SDK, which builds enclave applications using C and C++.
We will walk you through how to set up everything you need to use it in both simulation mode and hardware mode.
For the simulation set-up mode, you can technically use any development environment, but we'll be using the Linux distribution in this course. If you use a different setup, the packages might not work and the installation could be different. It might also work less well with OpenEnclaveSDK.
When building our KMS project we will tell you at the beginning of each section if it is possible to follow along in simulation mode!
To install the Open Enclave SDK packages and its dependencies, we'll first need to add the necessary repos to the package manager APT.
Use the following commands to configure the Intel and Microsoft Azure APT repositories for downloading and installing Intel SGX and Open Enclave:
Then, we'll install all the packages needed to simulate a running enclave with OpenEnclave.
You should now see that OpenEnclave was installed in the folder /opt/openenclave/.
To run OpenEnclave tools directly from our shell without having path issues, we are going to add the following command:
Then we'll make our development journey easier, by adding it directly to the .bashrc. It will make this change persistent in every new shell: