summaryrefslogtreecommitdiffstats
path: root/scripts/testuser-self-submit.sh
blob: ffcc21ee170fb14308dcee717dbc3d0fa5f722dc (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
#!/bin/sh

mkdir -p tmp

cat > tmp/testuser-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=tmp/testuser.csr

# Path for the CMC request.
output=tmp/testuser-cmc-request.bin
EOF

CMCRequest tmp/testuser-cmc-request.cfg

cat > tmp/testuser-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/profileSubmitCMCFull
servlet=/ca/ee/ca/profileSubmitCMCFull?profileId=caFullCMCUserSignedCert

# Path for the CMC request.
input=tmp/testuser-cmc-request.bin

# Path for the CMC response.
output=tmp/testuser-cmc-response.bin
EOF

HttpClient tmp/testuser-cmc-submit.cfg

CMCResponse -d ~/.dogtag/nssdb -i tmp/testuser-cmc-response.bin -o tmp/testuser.crt