Intel® Software Guard Extensions (Intel® SGX)
Discussion board focused on hardware-based isolation and memory encryption to provide extended code protection in solutions.

Using enclave in a Windows Forms Application ?

Charlotte_P_
Beginner
926 Views

Hello,

I would like to use an enclave in a Windows Forms Application (C#). Is it possible to do it ? Can I wrap an enclave library in another library ?

Thanks

Charlotte

0 Kudos
1 Solution
Francisco_C_Intel
926 Views

Yes, you can load enclaves in your C# application. Use whatever mechanism you normally use to call native C functions (sgx_create_enclavew) in non-managed DLLs (sgx_urts.dll).

Note that in the 1.1 version of the our runtime you may run into an issue (that has since been fixed) with COM thread initialization.

Basically, you will need to set the threading type of your C# Main function to [STAThread].  See below for an example.

        …
        [STAThread]
        static void Main(string[] args)
        …

View solution in original post

0 Kudos
2 Replies
Surenthar_S_Intel
926 Views

Hi Charlotte,

SGX application has dependency, we can build SGX enclave on C, C++ language only.

If external applications(JAVA,C# etc) wants to use SGX enclave, then developer need to create additional layer to communicate with SGX enclave.  It increases application complexity and potentially increases the attack surface.

Thanks and Regards,

Surenthar Selvaraj

 

0 Kudos
Francisco_C_Intel
927 Views

Yes, you can load enclaves in your C# application. Use whatever mechanism you normally use to call native C functions (sgx_create_enclavew) in non-managed DLLs (sgx_urts.dll).

Note that in the 1.1 version of the our runtime you may run into an issue (that has since been fixed) with COM thread initialization.

Basically, you will need to set the threading type of your C# Main function to [STAThread].  See below for an example.

        …
        [STAThread]
        static void Main(string[] args)
        …

0 Kudos
Reply