Windows10, x64,安装了visual studio,已经安装好了Intel SGX JDK。

源码下载:https://github.com/intel/sgx-ra-sample

源码说明文件:https://software.intel.com/content/www/us/en/develop/articles/code-sample-intel-software-guard-extensions-remote-attestation-end-to-end-example.html

API文档:https://software.intel.com/content/dam/develop/public/us/en/documents/sgx-attestation-api-spec.pdf

进入下面页面,注册,下载根CA文件和订阅。

进入订阅界面,看到SPID,Primary Key和Secondary Key,后面会用到这些。

下载源码,如果是wins,使用visual studio 2017打开,编译。具体编译过程参考源码所在github的说明。在源码的Enclave子项目中可以找到Enclave.config.xml文件。编译之后的sgx-ra-sample\vs\x64\Debug文件夹下面,找到setting.cmd,打开它们,这里暂时不用编辑前两者,只需编辑setting.cmd文件。

编辑好之后,进入sgx-ra-sample\vs\x64\Debug文件夹,依次双击run-server.cmd和run-client.cmd 两个文件。或者使用下面所示的另一种命令行的方式启动。前者更加方便一点。

setting.cmd文件:

:: NOTE: This file uses Windows batch file syntax because it is
:: executed via CALL from run-client.cmd and run-server.cmd::======================================================================
:: Global options
::======================================================================:: Set to non-zero to query the production IAS instead of development.
:: Note that the SPID and certificate are different for production
:: and development, so if you change this you'll need to change them,
:: too.SET RA_QUERY_IAS_PRODUCTION=0:: Your Service Provider ID. This should be a 32-character hex string.
:: [REQUIRED]SET RA_SPID=80删掉一部分8D0CBC509495469517F15AC5:: Set to a non-zero value if this SPID is associated with linkable
:: quotes. If you change this, you'll need to change SPID,
:: IAS_PRIMARY_SUBSCRIPTION_KEY and IAS_SECONDARY_SUBSCRIPTION_KEY too.SET RA_LINKABLE=1::======================================================================
:: Client options
::======================================================================:: Set to non-zero to have the client generate a random nonce.SET RA_RANDOM_NONCE=1:: Set to non-zero to have the client generate a platform manifest.
:: This requires a PSE session, and thus support for platform
:: services.
::
:: (Note that server hardware does not have platform servces)SET RA_USE_PLATFORM_SERVICES=0::======================================================================
:: Service provider (server) options
::======================================================================:: Intel Attestation Service Primary Subscription Key
:: More Info: https://api.portal.trustedservices.intel.com/EPID-attestation
:: Associated SPID above is requiredSET RA_IAS_PRIMARY_SUBSCRIPTION_KEY=99756删掉一部分e6fb2ae3c6a (从前面注册的网站上copy):: Intel Attestation Service  Secondary Subscription Key
:: This will be used in case the primary subscription key does not workSET RA_IAS_SECONDARY_SUBSCRIPTION_KEY=3ea3ce删掉一部分282e0d09b479d (从前面注册的网站上copy):: The Intel IAS SGX Report Signing CA file. You are sent this certificate
:: when you apply for access to SGX Developer Services at
:: http://software.intel.com/sgx [REQUIRED]SET RA_IAS_REPORT_SIGNING_CA_FILE=(自己的路径)C:/Users/liang/Documents/Intel_SGX_Attestation_RootCA.pem:: Set to the URL for your proxy server to force the use of a proxy
:: when communicating with IAS (overriding any environment variables).:: SET RA_IAS_PROXY_URL=:: Set to non-zero to disable the use of a proxy server and force a
:: direct connection when communicating with IAS (overriding any
:: environment variables).:: SET RA_IAS_DISABLE_PROXY=1::======================================================================
:: Debugging options
::======================================================================:: Set to non-zero for verbose outputSET RA_VERBOSE=1:: Set to non-zero for debugging outputSET RA_DEBUG=0

使用CMD进入sgx-ra-sample\vs\x64\Debug所在目录,执行下面命令启动server:

sp -v --spid 80D0CBC509495469517F15AC5 --ias-signing-cafile=C:/Users/liang/Documents/Intel_SGX_Attestation_RootCA.pem --mrsigner=bd71c6380ef77c5417e8删掉一部分18e5049342440cfff2443d95bd --isv-product-id=0 --min-isv-svn=1 --ias-pri-api-key=99756删掉一部分e6fb2ae3c6a  --ias-sec-api-key=3ea3ce删掉一部分282e0d09b479d  --linkable --no-proxy

使用另一个CMD进入相同的目录,执行下面命令启动client:

client -v  --spid 80删掉一部分8D0CBC509495469517F15AC5

下图是server的执行结果:

下图是client的部分执行结果:

最后的结果说本地的enclave是不可行的,原因跟bios没更新有关,该问题不在这篇笔记范围之内:

结束

Intel SGX Remote Attestation实例代码安装和执行,笔记相关推荐

  1. 详细介绍Intel SGX开发环境搭建和Hello Enclave程序运行

    这里记录Windows10下搭建Intel SGX开发环境和编写第一个Hello World程序的过程. 总共分为两部分,第一是环境搭建,第二是hello world程序编写.每一步都有截图,希望以通 ...

  2. Intel SGX开发者参考书(四)—— Enclave开发基础(一)

    @Intel SGX 读书笔记- Enclave开发基础 本章节介绍以下Enclave开发工具: 编写Enclave函数 调用函数到Enclave内 调用函数到Enclave外 将Enclave与库连 ...

  3. Intel SGX开发者参考书(四)—— Enclave开发基础(三)

    @Intel SGX 读书笔记- Enclave配置文件 Enclave配置文件是一个XML文件,包含用户定义的Enclave参数,此文件是Enclave项目的一部分.sgx_sign使用这个文件作为 ...

  4. java静态代码块和实例代码块

    一.静态代码块 1.什么是静态代码块? 用static修饰的代码块是静态代码块.它是在类加载时加载的,并且只会加载一次. 2.静态代码块的语法 static { java语句: java语句: } 3 ...

  5. Intel SGX开发者参考书(五)—— Intel SGX SDK示例代码(一)

    @Intel SGX 读书笔记- Intel SGX SDK示例代码 安装Intel SGX SDK后,你可以在[Intel SGX SDK Install Path]src下找到示例代码. 你可以在 ...

  6. Ubuntu16.04 编译安装intel SGX Driver,SDK,PSW并验证环境201905

    我的环境 阿里云ECS主机, 1 vCPU 4 GiB (I/O优化) 抢占性实例(便宜) Ubuntu 16.04 root用户完成以下所有操作.其他用户出现问题需要自己解决 时间2019年5月gi ...

  7. Ubuntu 16.04下Intel SGX驱动、平台软件和SDK安装

    本文作者:邱朋飞 本文介绍了在Ubuntu 16.04下安装Intel SGX驱动.平台软件和SDK的步骤.在安装过程中,参考了Intel提供的SGX驱动.平台软件和SDK安装文档,安装文档给出了更加 ...

  8. Intel SGX Explained

    文章目录 SGX新增 第二章 Intel体系架构背景知识 Overview 计算模型 软件权限级别 地址空间 地址转换 第五章 SGX Programming Medol 5.1 SGX物理内存组织 ...

  9. Intel SGX入坑必读——《Intel SGX Explained》(个人翻译,持续更新中)

    写在最前 入坑Intel SGX之前先打好基础.<Intel SGX Explained>就是入坑必读之一,有助于理解Intel SGX的原理.这里仅作个人翻译,便于加深理解,也方便感兴趣 ...

最新文章

  1. python画三维立体图-python_matplotlib画三维图
  2. 《专家系统(开发)--表达式检测--与表达式模板一起使用》
  3. dart系列之:时间你慢点走,我要在dart中抓住你
  4. 深入理解事件循环机制
  5. How to monitor your mobile application network traffic in your own LAPTOP
  6. 很实用的jQuery事件 - toggle() 方法
  7. unity 草 可以一棵棵种吗?_俗语“门前一棵柳,金银财宝往家走”啥意思?房前可以种柳树吗?...
  8. 快速序列化组件MessagePack介绍
  9. P2396-yyylovesMathsVII【状压dp】
  10. SicilyFunny Game
  11. 用ubuntu远程连接mysql_Ubuntu 安装 MySQL 和远程连接
  12. next按钮源码android,Android Edittext 软键盘输入法回车键改成下一步Next
  13. 中国搜 为人民服务 整合本地搜索引擎 出差旅游搜索国外国内当地服务网站 快速进行本地资源查找利用...
  14. 开发指南专题八:JEECG微云快速开发平台数据字典
  15. python注册大漠插件,大漠插件安装包
  16. CDA-LEVEL 1 数据分析师一级经验总结
  17. spss pro网络挑战赛A题:人群疏散模拟代码
  18. 「 LaTeX 」写论文,单双栏显示行号
  19. NKOJ 1361 帮帮吉米(Help Jimmy)
  20. Java HashMap底层实现

热门文章

  1. mysql count 返回0_如何在MySQL中使用COUNT時返回0而不是null
  2. java 汉字转拼音_推荐一款前端汉字转拼音组件工具
  3. linux下echo指令
  4. c++ 中 virtual / 纯虚函数(析构函数)测试
  5. Java测试工具使用(1)--Junit
  6. 微软私有云分享(R2)26配置基线与更新
  7. 别把你的目光停留在周围
  8. 连接函数vc++笔记---CDatabase类
  9. 在FreeBSD下安装mysql+apache+php
  10. dubbo 单元测试_技术分享——一路踩坑构建Dubbo源码