- root_dir: gdpr-sgx root directory
- cd root_dir
- run command
./scripts/install_deps.sh -r -s
to install dependencies - note: in Step 2, -r means install remote attestation dependencies while -s does for SGX SDK
- cd root_dir
- use
./scripts/build_targets.sh [options]
to build targets - in Step 2, there are some options for the command
- -r build remote attestation targets
- -m if you provide -r option the default value for -m is HW which builds targets in Hardware mode otherwise you can use SIM to build in simulation mode
- -s build SGX SDK
- -t build simple remote attestation and SGX SDK(if -r and -s are provided)
- -j build enclave client .so library file. The built targets will be moved to root_dir/target
- -h show usage information
- in EnclaveCPP, build libEnclaveBridge.so
- Following https://wiki.apache.org/tomcat/HowTo#I.27m_encountering_classloader_problems_when_using_JNI_under_Tomcat
create a directory,
${tomcat}/shared/lib, copy libEnclaveBridge.so into it. edit $ {tomcat}/conf/catalina.properties, look for "shared.loader", edit this line to: shared.loader="${catalina.home}/shared/lib/" - restart tomcat, and the EnclaveBridge should be connected to .so.
if logs shows "java.lang.RuntimeException: no EnclaveBridge in java.library.path", edit ${tomcat}/bin/catalina.sh, look for "JAVA_OPTS", edit this line to: JAVA_OPTS="$JAVA_OPTS $JSSE_OPTS -Djava.library.path=$CATALINA_HOME/shared/lib" restart tomcat, it should be working.
- $ cd comsgxtrial
- $ mvn package
- $ ls target/ com.sgxtrial.war
- $ cp com.sgxtrial.war $TOMCAT/webapps/
- $ restart tomcat, then visit http://localhost:8080/com.sgxtrial/webclient.html
- current javascript libraries are in resources/js/
- including protobuf_msg.js for serializing and deserializing Messages.Msg0-4.
- others are for ECDH encryptions.
- main logic for sending/receving Messages.MsgX is in webclient.html.
- Node.js javascript has some minor different Language Grammar than Browser javascript.
- to involve new javascript libraries from nodejs in browser, you need to install browserify to make it work.
- http://browserify.org/
- build protobuf for javascript
- EnclaveThreadManager is a file to init EnclaveBridge
- WebSocketServer.java is a file to handle websocket connections from browser.
- OnMessages is called every time when new byte[] incoming, it should pass byte[] directly to enclave, and gets byte[] from enclave and send back to javascript.