-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathkeys.gen
executable file
·36 lines (31 loc) · 945 Bytes
/
keys.gen
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
#!/bin/sh
set -e
mkdir keys
# root CA cert
openssl req -x509 \
-sha256 \
-days 356 \
-nodes \
-newkey rsa:2048 \
-subj "/C=AU/ST=Some-State/O=Internet Widgits Pty Ltd" \
-keyout keys/rootCA.key \
-out keys/rootCA.crt
for role in idp sp; do
# privkey and certificate signing request
openssl req -sha256 \
-nodes \
-newkey rsa:2048 \
-subj "/C=AU/ST=Some-State/O=Internet Widgits Pty Ltd" \
-keyout keys/$role.key \
-out keys/$role.csr
# certificate
openssl x509 -req \
-sha256 \
-days 365 \
-CA keys/rootCA.crt \
-CAkey keys/rootCA.key \
-CAcreateserial \
-in keys/$role.csr \
-out keys/$role.crt
done
cp -f keys/* NSO-vol/NSO1/etc/ssl/cert/.