Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Beginner
25 Views

Using enclave in a Windows Forms Application ?

Jump to solution

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

Accepted Solutions
Highlighted
25 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
Highlighted
25 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

 

- Surenthar Selvaraj
0 Kudos
Highlighted
26 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