Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
sgxwallet
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
董子豪
sgxwallet
Commits
27185d43
Unverified
Commit
27185d43
authored
Jan 21, 2020
by
svetaro
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add scripts for certificate creating
parent
8ad1e1a7
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
74 additions
and
0 deletions
+74
-0
ca.config
sgx_data/cert/ca.config
+37
-0
create_CA
sgx_data/cert/create_CA
+15
-0
create_client_cert
sgx_data/cert/create_client_cert
+8
-0
create_server_cert
sgx_data/cert/create_server_cert
+14
-0
No files found.
sgx_data/cert/ca.config
0 → 100644
View file @
27185d43
[
ca
]
default_ca
=
CA_CLIENT
# При подписи сертификатов
# использовать секцию CA_CLIENT
[
CA_CLIENT
]
dir
= .
# Каталог для служебных файлов
certs
= $
dir
/
certs
# Каталог для сертификатов
new_certs_dir
= $
dir
/
new_certs
# Каталог для новых сертификатов
database
= $
dir
/
index
.
txt
# Файл с базой данных
# подписанных сертификатов
serial
= $
dir
/
serial
# Файл содержащий серийный номер
RANDFILE
= $
dir
/.
rnd
# сертификата
# (в шестнадцатиричном формате)
certificate
= ./
rootCA
.
pem
# Файл сертификата CA
private_key
= ./
rootCA
.
key
# Файл закрытого ключа CA
default_days
=
3650
# Срок действия подписываемого
# сертификата
default_crl_days
=
7
# Срок действия CRL (см. $4)
default_md
=
sha256
# Алгоритм подписи
name_opt
=
ca_default
cert_opt
=
ca_default
policy
=
policy_anything
# Название секции с описанием
# политики в отношении данных
# сертификата
[
policy_anything
]
countryName
=
optional
# Код страны - не обязателен
stateOrProvinceName
=
optional
# ......
localityName
=
optional
# ......
organizationName
=
optional
# ......
organizationalUnitName
=
optional
# ......
commonName
=
supplied
# ...... - обязателен
emailAddress
=
optional
# ......
sgx_data/cert/create_CA
0 → 100755
View file @
27185d43
#!/bin/bash
# Generate root CA key
openssl genrsa
-out
rootCA.key 2048
# Create an X.509 cert from the CA key
openssl req
-x509
-sha256
-nodes
-days
1024
-newkey
rsa:2048
-key
rootCA.key
-out
rootCA.pem
-subj
"/CN=SGXCACertificate"
mkdir
new_certs
touch
index.txt
touch
index.txt.attr
echo
"01"
>
serial
sgx_data/cert/create_client_cert
0 → 100755
View file @
27185d43
#!/bin/bash
#sign csr
CSREXT
=
".csr"
CRTEXT
=
".crt"
CSRFILE
=
"
$1$CSREXT
"
CRTFILE
=
"
$1$CRTEXT
"
yes
| openssl ca
-config
ca.config
-in
$CSRFILE
-out
$CRTFILE
sgx_data/cert/create_server_cert
0 → 100755
View file @
27185d43
#!/bin/bash
# Generate server key
openssl genrsa
-out
"SGXServerCert.key"
2048
# Create server certificate request
#openssl req -new -key "SGXServer.key" -out "SGXServer.csr" -subj "/CN=SGXCACertificate"
openssl req
-new
-sha256
-nodes
-out
"SGXServerCert.csr"
-newkey
rsa:2048
-keyout
"SGXServerCert.key"
-subj
/CN
=
SGXServer
# Sign and generate the user certificate from the
#openssl x509 -req -in "SGXServer.csr" -CA rootCA.crt -CAkey rootCA.key -CAcreateserial -out "SGXServerCertificate.crt" -days 3650
yes
| openssl ca
-config
ca.config
-in
"SGXServerCert.csr"
-out
"SGXServerCert.crt"
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment