blob: ea9dc93910eaaa1b2a3cf9bf5ad395292e04b5b3 (
plain)
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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
|
#!/bin/sh
mkdir -p tmp
cat > tmp/kra_storage-cmc-request.cfg << EOF
# NSS database directory.
dbdir=$HOME/.dogtag/nssdb
# NSS database password.
password=Secret.123
# Token name (default is internal).
tokenname=internal
# Nickname for agent certificate.
nickname=caadmin
# Request format: pkcs10 or crmf.
format=pkcs10
# Total number of PKCS10/CRMF requests.
numRequests=1
# Path to the PKCS10/CRMF request.
# The content must be in Base-64 encoded format.
# Multiple files are supported. They must be separated by space.
input=$PWD/tmp/kra_storage.csr
# Path for the CMC request in binary format
output=$PWD/tmp/kra_storage-cmc-request.bin
EOF
CMCRequest tmp/kra_storage-cmc-request.cfg
cat > tmp/kra_storage-cmc-submit.cfg << EOF
# PKI server host name.
host=$HOSTNAME
# PKI server port number.
port=8443
# Use secure connection.
# For secure connection with ECC, set environment variable 'export NSS_USE_DECODED_CKA_EC_POINT=1'.
secure=true
# Use client authentication.
clientmode=true
# NSS database directory.
dbdir=$HOME/.dogtag/nssdb
# NSS database password.
password=Secret.123
# Token name (default: internal).
tokenname=internal
# Nickname of agent certificate.
nickname=caadmin
# CMC servlet path
#servlet=/ca/ee/ca/profileSubmitCMCFullKRAstorageCert
servlet=/ca/ee/ca/profileSubmitCMCFull?profileId=caCMCkraStorageCert
# Path for the CMC request.
input=tmp/kra_storage-cmc-request.bin
# Path for the CMC response.
output=tmp/kra_storage-cmc-response.bin
EOF
HttpClient tmp/kra_storage-cmc-submit.cfg
CMCResponse -d ~/.dogtag/nssdb -i tmp/kra_storage-cmc-response.bin -o tmp/kra_storage.crt
#BtoA tmp/kra_storage-cmc-response.bin tmp/kra_storage-cmc-response.b64
#echo "-----BEGIN PKCS7-----" > tmp/kra_storage.crt
#cat tmp/kra_storage-cmc-response.b64 >> tmp/kra_storage.crt
#echo "-----END PKCS7-----" >> tmp/kra_storage.crt
|