2014-06-22 03:13:37 +08:00
|
|
|
=pod
|
|
|
|
|
2016-05-22 02:49:33 +08:00
|
|
|
=head1 NAME
|
|
|
|
|
2014-06-22 03:13:37 +08:00
|
|
|
OCSP_response_status, OCSP_response_get1_basic, OCSP_response_create,
|
2016-09-13 00:39:55 +08:00
|
|
|
OCSP_RESPONSE_free, OCSP_RESPID_set_by_name,
|
2020-03-20 22:54:55 +08:00
|
|
|
OCSP_RESPID_set_by_key_ex, OCSP_RESPID_set_by_key, OCSP_RESPID_match_ex,
|
|
|
|
OCSP_RESPID_match, OCSP_basic_sign, OCSP_basic_sign_ctx
|
|
|
|
- OCSP response functions
|
2014-06-22 03:13:37 +08:00
|
|
|
|
|
|
|
=head1 SYNOPSIS
|
|
|
|
|
|
|
|
#include <openssl/ocsp.h>
|
|
|
|
|
|
|
|
int OCSP_response_status(OCSP_RESPONSE *resp);
|
|
|
|
OCSP_BASICRESP *OCSP_response_get1_basic(OCSP_RESPONSE *resp);
|
|
|
|
OCSP_RESPONSE *OCSP_response_create(int status, OCSP_BASICRESP *bs);
|
|
|
|
void OCSP_RESPONSE_free(OCSP_RESPONSE *resp);
|
|
|
|
|
2016-09-13 00:39:55 +08:00
|
|
|
int OCSP_RESPID_set_by_name(OCSP_RESPID *respid, X509 *cert);
|
2020-03-20 22:54:55 +08:00
|
|
|
int OCSP_RESPID_set_by_key_ex(OCSP_RESPID *respid, X509 *cert,
|
2020-10-15 17:55:50 +08:00
|
|
|
OSSL_LIB_CTX *libctx, const char *propq);
|
2016-09-13 00:39:55 +08:00
|
|
|
int OCSP_RESPID_set_by_key(OCSP_RESPID *respid, X509 *cert);
|
2020-10-15 17:55:50 +08:00
|
|
|
int OCSP_RESPID_match_ex(OCSP_RESPID *respid, X509 *cert, OSSL_LIB_CTX *libctx,
|
2020-03-20 22:54:55 +08:00
|
|
|
const char *propq);
|
2016-09-14 06:26:53 +08:00
|
|
|
int OCSP_RESPID_match(OCSP_RESPID *respid, X509 *cert);
|
2016-09-13 00:39:55 +08:00
|
|
|
|
2018-01-25 00:47:23 +08:00
|
|
|
int OCSP_basic_sign(OCSP_BASICRESP *brsp, X509 *signer, EVP_PKEY *key,
|
|
|
|
const EVP_MD *dgst, STACK_OF(X509) *certs,
|
|
|
|
unsigned long flags);
|
|
|
|
int OCSP_basic_sign_ctx(OCSP_BASICRESP *brsp, X509 *signer, EVP_MD_CTX *ctx,
|
|
|
|
STACK_OF(X509) *certs, unsigned long flags);
|
|
|
|
|
2014-06-22 03:13:37 +08:00
|
|
|
=head1 DESCRIPTION
|
|
|
|
|
2020-03-20 22:54:55 +08:00
|
|
|
OCSP_response_status() returns the OCSP response status of I<resp>. It returns
|
|
|
|
one of the values: I<OCSP_RESPONSE_STATUS_SUCCESSFUL>,
|
|
|
|
I<OCSP_RESPONSE_STATUS_MALFORMEDREQUEST>,
|
|
|
|
I<OCSP_RESPONSE_STATUS_INTERNALERROR>, I<OCSP_RESPONSE_STATUS_TRYLATER>
|
|
|
|
I<OCSP_RESPONSE_STATUS_SIGREQUIRED>, or I<OCSP_RESPONSE_STATUS_UNAUTHORIZED>.
|
2014-06-22 03:13:37 +08:00
|
|
|
|
2020-03-20 22:54:55 +08:00
|
|
|
OCSP_response_get1_basic() decodes and returns the I<OCSP_BASICRESP> structure
|
|
|
|
contained in I<resp>.
|
2014-06-22 03:13:37 +08:00
|
|
|
|
2020-03-20 22:54:55 +08:00
|
|
|
OCSP_response_create() creates and returns an I<OCSP_RESPONSE> structure for
|
|
|
|
I<status> and optionally including basic response I<bs>.
|
2014-06-22 03:13:37 +08:00
|
|
|
|
2020-03-20 22:54:55 +08:00
|
|
|
OCSP_RESPONSE_free() frees up OCSP response I<resp>.
|
2014-06-22 03:13:37 +08:00
|
|
|
|
2016-09-13 00:39:55 +08:00
|
|
|
OCSP_RESPID_set_by_name() sets the name of the OCSP_RESPID to be the same as the
|
2020-03-20 22:54:55 +08:00
|
|
|
subject name in the supplied X509 certificate I<cert> for the OCSP responder.
|
2016-09-13 00:39:55 +08:00
|
|
|
|
2020-03-20 22:54:55 +08:00
|
|
|
OCSP_RESPID_set_by_key_ex() sets the key of the OCSP_RESPID to be the same as the
|
|
|
|
key in the supplied X509 certificate I<cert> for the OCSP responder. The key is
|
|
|
|
stored as a SHA1 hash. To calculate the hash the SHA1 algorithm is fetched using
|
|
|
|
the library ctx I<libctx> and the property query string I<propq> (see
|
2021-03-26 01:02:25 +08:00
|
|
|
L<crypto(7)/ALGORITHM FETCHING> for further information).
|
2020-03-20 22:54:55 +08:00
|
|
|
|
|
|
|
OCSP_RESPID_set_by_key() does the same as OCSP_RESPID_set_by_key_ex() except
|
|
|
|
that the default library context is used with an empty property query string.
|
2016-09-13 00:39:55 +08:00
|
|
|
|
|
|
|
Note that an OCSP_RESPID can only have one of the name, or the key set. Calling
|
|
|
|
OCSP_RESPID_set_by_name() or OCSP_RESPID_set_by_key() will clear any existing
|
|
|
|
setting.
|
|
|
|
|
2020-03-20 22:54:55 +08:00
|
|
|
OCSP_RESPID_match_ex() tests whether the OCSP_RESPID given in I<respid> matches
|
|
|
|
with the X509 certificate I<cert> based on the SHA1 hash. To calculate the hash
|
|
|
|
the SHA1 algorithm is fetched using the library ctx I<libctx> and the property
|
2021-03-26 01:02:25 +08:00
|
|
|
query string I<propq> (see L<crypto(7)/ALGORITHM FETCHING> for further
|
2020-03-20 22:54:55 +08:00
|
|
|
information).
|
|
|
|
|
|
|
|
OCSP_RESPID_match() does the same as OCSP_RESPID_match_ex() except that the
|
|
|
|
default library context is used with an empty property query string.
|
2016-09-14 06:26:53 +08:00
|
|
|
|
2020-03-20 22:54:55 +08:00
|
|
|
OCSP_basic_sign() signs OCSP response I<brsp> using certificate I<signer>, private key
|
|
|
|
I<key>, digest I<dgst> and additional certificates I<certs>. If the I<flags> option
|
|
|
|
I<OCSP_NOCERTS> is set then no certificates will be included in the response. If the
|
|
|
|
I<flags> option I<OCSP_RESPID_KEY> is set then the responder is identified by key ID
|
|
|
|
rather than by name. OCSP_basic_sign_ctx() also signs OCSP response I<brsp> but
|
|
|
|
uses the parameters contained in digest context I<ctx>.
|
2018-01-25 00:47:23 +08:00
|
|
|
|
2014-06-22 03:13:37 +08:00
|
|
|
=head1 RETURN VALUES
|
|
|
|
|
|
|
|
OCSP_RESPONSE_status() returns a status value.
|
|
|
|
|
2020-03-20 22:54:55 +08:00
|
|
|
OCSP_response_get1_basic() returns an I<OCSP_BASICRESP> structure pointer or
|
|
|
|
I<NULL> if an error occurred.
|
2014-06-22 03:13:37 +08:00
|
|
|
|
2020-03-20 22:54:55 +08:00
|
|
|
OCSP_response_create() returns an I<OCSP_RESPONSE> structure pointer or I<NULL>
|
2014-06-22 03:13:37 +08:00
|
|
|
if an error occurred.
|
|
|
|
|
|
|
|
OCSP_RESPONSE_free() does not return a value.
|
|
|
|
|
2018-01-25 00:47:23 +08:00
|
|
|
OCSP_RESPID_set_by_name(), OCSP_RESPID_set_by_key(), OCSP_basic_sign(), and
|
|
|
|
OCSP_basic_sign_ctx() return 1 on success or 0
|
2016-09-13 00:39:55 +08:00
|
|
|
on failure.
|
|
|
|
|
2016-09-14 06:26:53 +08:00
|
|
|
OCSP_RESPID_match() returns 1 if the OCSP_RESPID and the X509 certificate match
|
|
|
|
or 0 otherwise.
|
|
|
|
|
2014-06-22 03:13:37 +08:00
|
|
|
=head1 NOTES
|
|
|
|
|
|
|
|
OCSP_response_get1_basic() is only called if the status of a response is
|
2020-03-20 22:54:55 +08:00
|
|
|
I<OCSP_RESPONSE_STATUS_SUCCESSFUL>.
|
2014-06-22 03:13:37 +08:00
|
|
|
|
|
|
|
=head1 SEE ALSO
|
|
|
|
|
2016-11-11 16:33:09 +08:00
|
|
|
L<crypto(7)>
|
2015-08-18 03:21:33 +08:00
|
|
|
L<OCSP_cert_to_id(3)>
|
|
|
|
L<OCSP_request_add1_nonce(3)>
|
|
|
|
L<OCSP_REQUEST_new(3)>
|
2016-11-11 16:33:09 +08:00
|
|
|
L<OCSP_resp_find_status(3)>
|
2015-08-18 03:21:33 +08:00
|
|
|
L<OCSP_sendreq_new(3)>
|
2016-09-13 00:39:55 +08:00
|
|
|
L<OCSP_RESPID_new(3)>
|
|
|
|
L<OCSP_RESPID_free(3)>
|
|
|
|
|
|
|
|
=head1 HISTORY
|
|
|
|
|
2016-09-14 06:26:53 +08:00
|
|
|
The OCSP_RESPID_set_by_name(), OCSP_RESPID_set_by_key() and OCSP_RESPID_match()
|
2017-07-15 21:39:45 +08:00
|
|
|
functions were added in OpenSSL 1.1.0a.
|
2014-06-22 03:13:37 +08:00
|
|
|
|
2018-01-25 00:47:23 +08:00
|
|
|
The OCSP_basic_sign_ctx() function was added in OpenSSL 1.1.1.
|
|
|
|
|
2016-05-18 23:44:05 +08:00
|
|
|
=head1 COPYRIGHT
|
|
|
|
|
2021-04-08 20:04:41 +08:00
|
|
|
Copyright 2015-2021 The OpenSSL Project Authors. All Rights Reserved.
|
2016-05-18 23:44:05 +08:00
|
|
|
|
2018-12-06 21:04:44 +08:00
|
|
|
Licensed under the Apache License 2.0 (the "License"). You may not use
|
2016-05-18 23:44:05 +08:00
|
|
|
this file except in compliance with the License. You can obtain a copy
|
|
|
|
in the file LICENSE in the source distribution or at
|
|
|
|
L<https://www.openssl.org/source/license.html>.
|
|
|
|
|
|
|
|
=cut
|