4 # This script need openssl 0.9.8a or newer, so it can parse the
5 # otherName section for pkinit certificates.
12 keytype
=${6:-rsa:1024}
21 -out cert.req
> /dev
/null
2>/dev
/null
23 if [ "$3" = "ca" ] ; then
28 -extfile openssl.cnf \
33 ln -s ca.crt
`${openssl} x509 -hash -noout -in cert.crt`.0
37 elif [ "$3" = "proxy" ] ; then
47 -extfile openssl.cnf \
75 gen_cert
"/CN=hx509 Test Root CA/C=SE" "root" "ca" "v3_ca"
76 gen_cert
"/CN=OCSP responder/C=SE" "ca" "ocsp-responder" "ocsp"
77 gen_cert
"/CN=Test cert/C=SE" "ca" "test" "usr"
78 gen_cert
"/CN=Revoke cert/C=SE" "ca" "revoke" "usr"
79 gen_cert
"/CN=Test cert KeyEncipherment/C=SE" "ca" "test-ke-only" "usr_ke"
80 gen_cert
"/CN=Test cert DigitalSignature/C=SE" "ca" "test-ds-only" "usr_ds"
81 gen_cert
"/CN=pkinit/C=SE" "ca" "pkinit" "pkinit_client"
82 $openssl ecparam
-name secp256r1
-out eccurve.pem
83 gen_cert
"/CN=pkinit-ec/C=SE" "ca" "pkinit-ec" "pkinit_client" "XXX" ec
:eccurve.pem
84 gen_cert
"/C=SE/CN=pkinit/CN=pkinit-proxy" "pkinit" "proxy" "proxy_cert" pkinit-proxy
85 gen_cert
"/CN=kdc/C=SE" "ca" "kdc" "pkinit_kdc"
86 gen_cert
"/CN=www.test.h5l.se/C=SE" "ca" "https" "https"
87 gen_cert
"/CN=Sub CA/C=SE" "ca" "sub-ca" "subca"
88 gen_cert
"/CN=Test sub cert/C=SE" "sub-ca" "sub-cert" "usr"
89 gen_cert
"/C=SE/CN=Test cert/CN=proxy" "test" "proxy" "proxy_cert" proxy-test
90 gen_cert
"/C=SE/CN=Test cert/CN=proxy/CN=child" "proxy-test" "proxy" "proxy_cert" proxy-level-test
91 gen_cert
"/C=SE/CN=Test cert/CN=no-proxy" "test" "proxy" "usr_cert" no-proxy-test
92 gen_cert
"/C=SE/CN=Test cert/CN=proxy10" "test" "proxy" "proxy10_cert" proxy10-test
93 gen_cert
"/C=SE/CN=Test cert/CN=proxy10/CN=child" "proxy10-test" "proxy" "proxy10_cert" proxy10-child-test
94 gen_cert
"/C=SE/CN=Test cert/CN=proxy10/CN=child/CN=child" "proxy10-child-test" "proxy" "proxy10_cert" proxy10-child-child-test
98 cat sub-ca.crt ca.crt
> sub-ca-combined.crt
99 cat test.crt
test.key
> test.combined.crt
100 cat pkinit-proxy.crt pkinit.crt
> pkinit-proxy-chain.crt
102 # password protected key
103 ${openssl} rsa
-in test.key
-aes256 -passout pass
:foobar
-out test-pw.key
104 ${openssl} rsa
-in pkinit.key
-aes256 -passout pass
:foo
-out pkinit-pw.key
118 -passout pass
:foobar \
120 -name "friendlyname-test" \
127 -inkey sub-cert.key \
128 -passout pass
:foobar \
130 -name "friendlyname-sub-cert" \
131 -certfile sub-ca-combined.crt \
141 -passout pass
:foobar \
143 -name "friendlyname-cert" \
155 -out test-signed-data
166 -out test-signed-data-noattr
178 -out test-signed-data-noattr-nocerts
189 -out test-signed-sha-1
200 -out test-signed-sha-256
211 -out test-signed-sha-512
220 -out test-enveloped-rc2-40 \
230 -out test-enveloped-rc2-64 \
240 -out test-enveloped-rc2-128 \
250 -out test-enveloped-des \
260 -out test-enveloped-des-ede3 \
270 -out test-enveloped-aes-128 \
280 -out test-enveloped-aes-256 \
289 -reqout ocsp-req1.der
293 -rsigner ocsp-responder.crt \
294 -rkey ocsp-responder.key \
296 -reqin ocsp-req1.der \
298 -respout ocsp-resp1-ocsp.der
305 -reqin ocsp-req1.der \
307 -respout ocsp-resp1-ca.der
311 -rsigner ocsp-responder.crt \
312 -rkey ocsp-responder.key \
315 -reqin ocsp-req1.der \
317 -respout ocsp-resp1-ocsp-no-cert.der
321 -rsigner ocsp-responder.crt \
322 -rkey ocsp-responder.key \
324 -reqin ocsp-req1.der \
327 -respout ocsp-resp1-keyhash.der
332 -reqout ocsp-req2.der
336 -rsigner ocsp-responder.crt \
337 -rkey ocsp-responder.key \
339 -reqin ocsp-req2.der \
341 -respout ocsp-resp2.der
349 -crl_reason superseded \
353 ${openssl} crl
-in crl1.crl
-outform der
-out crl1.der