Kun tuo urli on saatu niin voit tehdä ocsp haun käyttäen seuraavaa komentoa:
openssl ocsp -CApath certs -issuer certs/vrkcqc3.pem $issuer -cert cert.pem -url $OCSP
missä '''$issuer''' on oikea varmenteen myöntäjä ja missä '''certs''' hakemistossa on vrkcqc2.pem, vrkcqc3.pem vrkrootc.pem ja vrkroot2c.pem tiedostot ja niiden symlinkit. Tuon hakemiston saa tehtyä seuraavilla komennoilla.
mkdir certs
for i in vrkrootc vrkcqc2 vrkroot2c vrkcqc3
do
echo Fetching http://proxy.fineid.fi/ca/$i.crt
#!/bin/sh
if [ "x$1" = "x" ]; then search="(&(givenname=Tero)(sn=Kivinen))"else search="$1"fi
rm -rf certs
mkdir certs
for i in vrkrootc vrkcqc2 vrkroot2c vrkcqc3
do
echo Fetching http://proxy.fineid.fi/ca/$i.crt
while read cert
do
num=`expr $num + 1` a=`echo $cert | sed 's/.*:: //g'` (echo '-----BEGIN X509 CERTIFICATE-----' ; echo $a; echo '-----END X509 CERTIFICATE-----') > certs/cert$num.pem
SUBJECT=`openssl x509 -in certs/cert$num.pem -text -noout | fgrep Subject: | sed 's/.*Subject:://g'` OCSP=`openssl x509 -in certs/cert$num.pem -text -noout | fgrep OCSP | sed 's/.*URI://g'` case "$OCSP" in *vrkcqc2) issuer=certs/vrkcqc2.pem ;; *vrkcqc3) issuer=certs/vrkcqc3.pem ;; *) echo "Unknown issuer"; exit 1; esac echo Subject: $SUBJECT echo OCPS link: $OCSP openssl ocsp -CApath certs -issuer "$issuer" -cert certs/vrkcqc3.pem -cert cert$num.pem -url $OCSP
done
</pre>
<pre>
Fetching http://proxy.fineid.fi/ca/vrkrootc.crt
Converting it to pem, and making CApath directory link
Fetching http://proxy.fineid.fi/ca/vrkcqc2.crt
Converting it to pem, and making CApath directory link
Fetching http://proxy.fineid.fi/ca/vrkroot2c.crt
Converting it to pem, and making CApath directory link
Subject: Subject: C = FI, serialNumber = 14683812B, GN = TERO, SN = KIVINEN, CN = KIVINEN TERO 14683812B
OCPS link: http://ocsp.fineid.fi/vrkcqc2
Responder ErrorResponse verify OKcerts/cert1.pem: unauthorized (6)good This Update: Mar 7 16:20:08 2021 GMT Next Update: Mar 8 00:20:08 2021 GMT
Subject: Subject: C = FI, serialNumber = 13991724X, GN = TERO, SN = KIVINEN, CN = KIVINEN TERO 13991724X
OCPS link: http://ocsp.fineid.fi/vrkcqc3
Response verify OK
certs/cert2.pem: good This Update: Mar 2 087 16:2431:21 58 2021 GMT Next Update: Mar 2 168 00:2431:21 58 2021 GMT
Subject: Subject: C = FI, serialNumber = 133366417, GN = TERO, SN = KIVINEN, CN = KIVINEN TERO 133366417
OCPS link: http://ocsp.fineid.fi/vrkcqc3
Response verify OK
certs/cert3.pem: good This Update: Mar 2 087 16:2431:21 58 2021 GMT Next Update: Mar 2 168 00:2431:21 58 2021 GMT
</pre>