-
Notifications
You must be signed in to change notification settings - Fork 1
/
run_demo_sgxra.sh
executable file
·44 lines (36 loc) · 1.25 KB
/
run_demo_sgxra.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#!/bin/sh -e
# -*- Makefile -*-
#
# Copyright (C) 2011-2019 Intel Corporation
#
# SPDX-License-Identifier: BSD-3-Clause
#
test -d demo_sgx || mkdir demo_sgx
# Clean up from previous runs
rm -f demo_sgx/*
cd demo_sgx
echo "Provisioning private elliptic curve key:"
# Generate the keypair (both private & public keys are sealed to enclave)
#../app/app --keygen --enclave-path `pwd`/../enclave/enclave.signed.so --statefile sealeddata.bin --public-key secp256r1.pem
../app/app --keygen \
--enclave-path `pwd`/../enclave/enclave.signed.so \
--sealedprivkey sealedprivkey.bin \
--sealedpubkey sealedpubkey.bin \
--public-key secp256r1.pem
echo "Key provisoning completed.\n"
echo "\nGenerating quote for remote attestation:"
# Generate the quote
../app/app --quote \
--enclave-path `pwd`/../enclave/enclave.signed.so \
--sealedpubkey sealedpubkey.bin \
--quotefile quote.bin
echo "Quote generation completed.\n"
echo "\nSigning sensor data:"
../app/app --sign \
--enclave-path `pwd`/../enclave/enclave.signed.so \
--sealedprivkey sealedprivkey.bin \
--signature Sensor_Data.signature ../Sensor_Data
echo "Sensor data signed.\n"
echo "\nVerifying quote and signature:"
cd ..
python verify.py