Seth Woolley's Man Viewer

ocsp(1) - ocsp - Online Certificate Status Protocol utility - man 1 ocsp

([section] manual, -k keyword, -K [section] search, -f whatis)
man plain no title

OCSP(1)                             OpenSSL                            OCSP(1)

       ocsp - Online Certificate Status Protocol utility

       openssl ocsp [-out file(1,n)] [-issuer file(1,n)] [-cert file(1,n)] [-serial n]
       [-signer file(1,n)] [-signkey file(1,n)] [-sign_other file(1,n)] [-no_certs]
       [-req_text] [-resp_text] [-text] [-reqout file(1,n)] [-respout file(1,n)] [-reqin
       file(1,n)] [-respin file(1,n)] [-nonce] [-no_nonce] [-url URL] [-host host:n]
       [-path] [-CApath dir] [-CAfile file(1,n)] [-VAfile file(1,n)] [-validity_period
       n] [-status_age n] [-noverify] [-verify_other file(1,n)] [-trust_other]
       [-no_intern] [-no_signature_verify] [-no_cert_verify] [-no_chain]
       [-no_cert_checks] [-port num] [-index file(1,n)] [-CA file(1,n)] [-rsigner file(1,n)]
       [-rkey file(1,n)] [-rother file(1,n)] [-resp_no_certs] [-nmin n] [-ndays n]
       [-resp_key_id] [-nrequest n]

       The Online Certificate Status Protocol (OCSP) enables applications to
       determine the (revocation) state of an identified certificate (RFC

       The ocsp command performs many common OCSP tasks. It can be used to
       print out requests and responses, create requests and send(2,n) queries to
       an OCSP responder and behave like a mini OCSP server itself.

       -out filename
           specify output filename, default is standard output.

       -issuer filename
           This specifies the current issuer certificate. This option can be
           used multiple times. The certificate specified in(1,8) filename must be
           in(1,8) PEM format.

       -cert filename
           Add the certificate filename to the request. The issuer certificate
           is taken from the previous issuer option, or an error(8,n) occurs if(3,n) no
           issuer certificate is specified.

       -serial num
           Same as the cert option except the certificate with serial number
           num is added to the request. The serial number is interpreted as a
           decimal integer unless preceded by 0x. Negative integers can also
           be specified by preceding the value by a - sign.

       -signer filename, -signkey filename
           Sign the OCSP request using the certificate specified in(1,8) the signer
           option and the private key specified by the signkey option. If the
           signkey option is not present then the private key is read(2,n,1 builtins) from the
           same file(1,n) as the certificate. If neither option is specified then
           the OCSP request is not signed.

       -sign_other filename
           Additional certificates to include in(1,8) the signed request.

       -nonce, -no_nonce
           Add an OCSP nonce extension to a request or disable OCSP nonce
           addition.  Normally if(3,n) an OCSP request is input using the respin
           option no nonce is added: using the nonce option will force addi-
           tion of a nonce.  If an OCSP request is being created (using cert
           and serial options) a nonce is automatically added specifying
           no_nonce overrides this.

       -req_text, -resp_text, -text
           print out the text form of the OCSP request, response or both

       -reqout file(1,n), -respout file(1,n)
           write(1,2) out the DER encoded certificate request or response to file(1,n).

       -reqin file(1,n), -respin file(1,n)
           read(2,n,1 builtins) OCSP request or response file(1,n) from file(1,n). These option are
           ignored if(3,n) OCSP request or response creation is implied by other
           options (for example with serial, cert and host(1,5) options).

       -url responder_url
           specify the responder URL. Both HTTP and HTTPS (SSL/TLS) URLs can
           be specified.

       -host hostname:port, -path pathname
           if(3,n) the host(1,5) option is present then the OCSP request is sent to the
           host(1,5) hostname on port port. path specifies the HTTP path name to
           use or "/" by default.

       -CAfile file(1,n), -CApath pathname
           file(1,n) or pathname containing trusted CA certificates. These are used
           to verify(1,8) the signature on the OCSP response.

       -verify_other file(1,n)
           file(1,n) containing additional certificates to search when attempting
           to locate the OCSP response signing certificate. Some responders
           omit the actual signer's certificate from the response: this option
           can be used to supply the necessary certificate in(1,8) such cases.

           the certificates specified by the -verify_certs option should be
           explicitly trusted and no additional checks will be performed on
           them. This is useful when the complete responder certificate chain
           is not available or trusting a root CA is not appropriate.

       -VAfile file(1,n)
           file(1,n) containing explicitly trusted responder certificates. Equiva-
           lent to the -verify_certs and -trust_other options.

           don't attempt to verify(1,8) the OCSP response signature or the nonce
           values. This option will normally only be used for debugging since
           it disables all verification of the responders certificate.

           ignore certificates contained in(1,8) the OCSP response when searching
           for the signers certificate. With this option the signers certifi-
           cate must be specified with either the -verify_certs or -VAfile

           don't check the signature on the OCSP response. Since this option
           tolerates invalid signatures on OCSP responses it will normally
           only be used for testing purposes.

           don't verify(1,8) the OCSP response signers certificate at all. Since
           this option allows the OCSP response to be signed by any certifi-
           cate it should only be used for testing purposes.

           do not use certificates in(1,8) the response as additional untrusted CA

           don't perform any additional checks on the OCSP response signers
           certificate.  That is do not make any checks to see if(3,n) the signers
           certificate is authorised to provide the necessary status informa-
           tion: as a result this option should only be used for testing pur-

       -validity_period nsec, -status_age age
           these options specify the range of times, in(1,8) seconds, which will be
           tolerated in(1,8) an OCSP response. Each certificate status response
           includes a notBefore time(1,2,n) and an optional notAfter time. The cur-
           rent time(1,2,n) should fall between these two values, but the interval
           between the two times may be only a few seconds. In practice the
           OCSP responder and clients clocks may not be precisely synchronised
           and so such a check may fail. To avoid this the -validity_period
           option can be used to specify an acceptable error(8,n) range in(1,8) seconds,
           the default value is 5 minutes.

           If the notAfter time(1,2,n) is omitted from a response then this means
           that new status information is immediately available. In this case
           the age of the notBefore field is checked to see it is not older
           than age seconds old. By default this additional check is not per-

       -index indexfile
           indexfile is a text index file(1,n) in(1,8) ca format containing certificate
           revocation information.

           If the index option is specified the ocsp utility is in(1,8) responder
           mode, otherwise it is in(1,8) client mode. The request(s) the responder
           processes can be either specified on the command line (using issuer
           and serial options), supplied in(1,8) a file(1,n) (using the respin option)
           or via external OCSP clients (if(3,n) port or url is specified).

           If the index option is present then the CA and rsigner options must
           also be present.

       -CA file(1,n)
           CA certificate corresponding to the revocation information in(1,8)

       -rsigner file(1,n)
           The certificate to sign OCSP responses with.

       -rother file(1,n)
           Additional certificates to include in(1,8) the OCSP response.

           Don't include any certificates in(1,8) the OCSP response.

           Identify the signer certificate using the key ID, default is to use
           the subject name.

       -rkey file(1,n)
           The private key to sign OCSP responses with: if(3,n) not present the
           file(1,n) specified in(1,8) the rsigner option is used.

       -port portnum
           Port to listen(1,2,7) for OCSP requests on. The port may also be specified
           using the url option.

       -nrequest number
           The OCSP server will exit(3,n,1 builtins) after receiving number requests, default

       -nmin minutes, -ndays days
           Number of minutes or days when fresh revocation information is
           available: used in(1,8) the nextUpdate field. If neither option is
           present then the nextUpdate field is omitted meaning fresh revoca-
           tion information is immediately available.

OCSP Response verification.
       OCSP Response follows the rules specified in(1,8) RFC2560.

       Initially the OCSP responder certificate is located and the signature
       on the OCSP request checked using the responder certificate's public

       Then a normal certificate verify(1,8) is performed on the OCSP responder
       certificate building up a certificate chain in(1,8) the process. The loca-
       tions of the trusted certificates used to build the chain can be speci-
       fied by the CAfile and CApath options or they will be looked for in(1,8) the
       standard OpenSSL certificates directory.

       If the initial verify(1,8) fails then the OCSP verify(1,8) process halts with an

       Otherwise the issuing CA certificate in(1,8) the request is compared to the
       OCSP responder certificate: if(3,n) there is a match then the OCSP verify(1,8)

       Otherwise the OCSP responder certificate's CA is checked against the
       issuing CA certificate in(1,8) the request. If there is a match and the
       OCSPSigning extended key usage is present in(1,8) the OCSP responder cer-
       tificate then the OCSP verify(1,8) succeeds.

       Otherwise the root CA of the OCSP responders CA is checked to see if(3,n) it
       is trusted for OCSP signing. If it is the OCSP verify(1,8) succeeds.

       If none of these checks is successful then the OCSP verify(1,8) fails.

       What this effectively means if(3,n) that if(3,n) the OCSP responder certificate
       is authorised directly by the CA it is issuing revocation information
       about (and it is correctly configured) then verification will succeed.

       If the OCSP responder is a "global responder" which can give details
       about multiple CAs and has its own separate certificate chain then its
       root CA can be trusted for OCSP signing. For example:

        openssl x509 -in ocspCA.pem -addtrust OCSPSigning -out trustedCA.pem

       Alternatively the responder certificate itself can be explicitly
       trusted with the -VAfile option.

       As noted, most of the verify(1,8) options are for testing or debugging pur-
       poses.  Normally only the -CApath, -CAfile and (if(3,n) the responder is a
       'global VA') -VAfile options need to be used.

       The OCSP server is only useful for test and demonstration purposes: it
       is not really usable as a full OCSP responder. It contains only a very
       simple HTTP request handling and can only handle the POST form of OCSP
       queries. It also handles requests serially meaning it cannot respond to
       new requests until it has processed the current one. The text index
       file(1,n) format of revocation is also inefficient for large quantities of
       revocation data.

       It is possible to run the ocsp application in(1,8) responder mode via a CGI
       script using the respin and respout options.

       Create an OCSP request and write(1,2) it to a file:

        openssl ocsp -issuer issuer.pem -cert c1.pem -cert c2.pem -reqout req.der

       Send a query to an OCSP responder with URL save
       the response to a file(1,n) and print it out in(1,8) text form

        openssl ocsp -issuer issuer.pem -cert c1.pem -cert c2.pem \
            -url -resp_text -respout resp.der

       Read in(1,8) an OCSP response and print out text form:

        openssl ocsp -respin resp.der -text

       OCSP server on port 8888 using a standard ca configuration, and a sepa-
       rate responder certificate. All requests and responses are printed to a

        openssl ocsp -index demoCA/index.txt -port 8888 -rsigner rcert.pem -CA demoCA/cacert.pem
               -text -out log.txt

       As above but exit(3,n,1 builtins) after processing one request:

        openssl ocsp -index demoCA/index.txt -port 8888 -rsigner rcert.pem -CA demoCA/cacert.pem
            -nrequest 1

       Query status information using internally generated request:

        openssl ocsp -index demoCA/index.txt -rsigner rcert.pem -CA demoCA/cacert.pem
            -issuer demoCA/cacert.pem -serial 1

       Query status information using request read(2,n,1 builtins) from a file(1,n), write(1,2) response
       to a second file.

        openssl ocsp -index demoCA/index.txt -rsigner rcert.pem -CA demoCA/cacert.pem
            -reqin req.der -respout resp.der

0.9.7d                            2003-03-25                           OCSP(1)

References for this manual (incoming links)