-
Notifications
You must be signed in to change notification settings - Fork 26
/
demo-cli.sh
executable file
·43 lines (34 loc) · 1.38 KB
/
demo-cli.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
#!/bin/bash
#
# Демонстрация основных возможностей командной строки
#
cd "$(dirname "$0")"
source scripts/lib/colors.sh
source scripts/lib/functions.sh
warning 'Установка корневого сертификата'
info 'curl -sS http://testca2012.cryptopro.ru/cert/rootca.cer | docker exec -i cryptopro /scripts/root'
sleep 5
echo
curl -sS http://testca2012.cryptopro.ru/cert/rootca.cer | docker exec -i cryptopro /scripts/root
echo
sleep 2
warning 'Установка сертификата + закрытый ключ'
info 'cat certificates/bundle-pin.zip | docker exec -i cryptopro /scripts/my 12345678'
sleep 5
echo
cat certificates/bundle-pin.zip | docker exec -i cryptopro /scripts/my 12345678
echo
sleep 2
warning 'Подписание документа'
info 'cat README.md | docker exec -i cryptopro /scripts/sign dd45247ab9db600dca42cc36c1141262fa60e3fe 12345678'
sleep 5
echo
cat README.md | docker exec -i cryptopro /scripts/sign dd45247ab9db600dca42cc36c1141262fa60e3fe 12345678
echo
sleep 2
warning 'Проверка подписи документа'
info 'cat /tmp/README.md.sig | docker exec -i cryptopro scripts/verify'
cat README.md | docker exec -i cryptopro /scripts/sign dd45247ab9db600dca42cc36c1141262fa60e3fe 12345678 > /tmp/README.md.sig
sleep 5
echo
cat /tmp/README.md.sig | docker exec -i cryptopro scripts/verify