《云原生机密计算最佳实践白皮书》——05编程框架——Apache Teaclave Java TEE SDK: 面向Java生态的机密计算编程框架——Apache_Teaclave_ Java_TEE_SDK 最佳实践(2) https://developer.aliyun.com/article/1231435?groupCode=aliyun_linux
3. 运行项目test/benchmark/sample
3.1 进入容器环境
目前Teaclave-Java-Tee-SDK支持两种容器环境ubuntu18.04和anolis8.6.
docker run -it --privileged --network host -v /dev/sgx_enclave:/dev/sgx/enclave -v /dev/sgx _provision:/dev/sgx/provision teaclave/teaclave-java-tee-sdk:v0.1.0-ubuntu18.04 /bin/bash
或
docker run -it --privileged --network host -v /dev/sgx_enclave:/dev/sgx/enclave -v /dev/sgx _provision:/dev/sgx/provision teaclave/teaclave-java-tee-sdk:v0.1.0-ubuntu18.04 /bin/bash
3.2 运行samples
cd /opt/javaenclave/samples
运行 HelloWorld Sample:
cd helloworld && ./run.sh
结果如下即代表运行成功:
Downloading ........... [INFO] [INFO] helloworld ......................................... SUCCESS [ 0.758 s] [INFO] common ............................................. SUCCESS [ 5.766 s] [INFO] enclave ............................................ SUCCESS [ 55.070 s] [INFO] host ............................................... SUCCESS [ 25.544 s] [INFO] ------------------------------------------------------------------------ [INFO] BUILD SUCCESS [INFO] ------------------------------------------------------------------------ [INFO] Total time: 01:27 min [INFO] Finished at: 2023-02-16T12:27:18Z [INFO] ------------------------------------------------------------------------ Hello World Hello World Hello World Hello World
运行 Springboot Sample:
cd springboot && ./run.sh
结果如下即代表运行成功:
[INFO] Replacing main artifact with repackaged archive [INFO] ------------------------------------------------------------------------ [INFO] Reactor Summary for springboot 1.0-SNAPSHOT: [INFO] [INFO] springboot ......................................... SUCCESS [ 22.343 s] [INFO] common ............................................. SUCCESS [06:46 min] [INFO] enclave ............................................ SUCCESS [02:52 min] [INFO] host ............................................... SUCCESS [02:58 min] [INFO] ------------------------------------------------------------------------ [INFO] BUILD SUCCESS [INFO] ------------------------------------------------------------------------ [INFO] Total time: 14:38 min [INFO] Finished at: 2023-02-16T11:28:49Z [INFO] ------------------------------------------------------------------------ . ____ _ __ _ _ /\\ / ___'_ __ _ _(_)_ __ __ _ \ \ \ \ ( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \ \\/ ___)| |_)| | | | | || (_| | ) ) ) )
9若因网络原因无法下载依赖,可通过配置Maven镜像源解决
《云原生机密计算最佳实践白皮书》——05编程框架——Apache Teaclave Java TEE SDK: 面向Java生态的机密计算编程框架——Apache_Teaclave_ Java_TEE_SDK 最佳实践(4) https://developer.aliyun.com/article/1231432?groupCode=aliyun_linux