2
0

OCSP_response_status.pod 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  1. =pod
  2. =head1 NAME
  3. OCSP_response_status, OCSP_response_get1_basic, OCSP_response_create,
  4. OCSP_RESPONSE_free, OCSP_RESPID_set_by_name,
  5. OCSP_RESPID_set_by_key, OCSP_RESPID_match,
  6. OCSP_basic_sign, OCSP_basic_sign_ctx - OCSP response functions
  7. =head1 SYNOPSIS
  8. #include <openssl/ocsp.h>
  9. int OCSP_response_status(OCSP_RESPONSE *resp);
  10. OCSP_BASICRESP *OCSP_response_get1_basic(OCSP_RESPONSE *resp);
  11. OCSP_RESPONSE *OCSP_response_create(int status, OCSP_BASICRESP *bs);
  12. void OCSP_RESPONSE_free(OCSP_RESPONSE *resp);
  13. int OCSP_RESPID_set_by_name(OCSP_RESPID *respid, X509 *cert);
  14. int OCSP_RESPID_set_by_key(OCSP_RESPID *respid, X509 *cert);
  15. int OCSP_RESPID_match(OCSP_RESPID *respid, X509 *cert);
  16. int OCSP_basic_sign(OCSP_BASICRESP *brsp, X509 *signer, EVP_PKEY *key,
  17. const EVP_MD *dgst, STACK_OF(X509) *certs,
  18. unsigned long flags);
  19. int OCSP_basic_sign_ctx(OCSP_BASICRESP *brsp, X509 *signer, EVP_MD_CTX *ctx,
  20. STACK_OF(X509) *certs, unsigned long flags);
  21. =head1 DESCRIPTION
  22. OCSP_response_status() returns the OCSP response status of B<resp>. It returns
  23. one of the values: B<OCSP_RESPONSE_STATUS_SUCCESSFUL>,
  24. B<OCSP_RESPONSE_STATUS_MALFORMEDREQUEST>,
  25. B<OCSP_RESPONSE_STATUS_INTERNALERROR>, B<OCSP_RESPONSE_STATUS_TRYLATER>
  26. B<OCSP_RESPONSE_STATUS_SIGREQUIRED>, or B<OCSP_RESPONSE_STATUS_UNAUTHORIZED>.
  27. OCSP_response_get1_basic() decodes and returns the B<OCSP_BASICRESP> structure
  28. contained in B<resp>.
  29. OCSP_response_create() creates and returns an B<OCSP_RESPONSE> structure for
  30. B<status> and optionally including basic response B<bs>.
  31. OCSP_RESPONSE_free() frees up OCSP response B<resp>.
  32. OCSP_RESPID_set_by_name() sets the name of the OCSP_RESPID to be the same as the
  33. subject name in the supplied X509 certificate B<cert> for the OCSP responder.
  34. OCSP_RESPID_set_by_key() sets the key of the OCSP_RESPID to be the same as the
  35. key in the supplied X509 certificate B<cert> for the OCSP responder. The key is
  36. stored as a SHA1 hash.
  37. Note that an OCSP_RESPID can only have one of the name, or the key set. Calling
  38. OCSP_RESPID_set_by_name() or OCSP_RESPID_set_by_key() will clear any existing
  39. setting.
  40. OCSP_RESPID_match() tests whether the OCSP_RESPID given in B<respid> matches
  41. with the X509 certificate B<cert>.
  42. OCSP_basic_sign() signs OCSP response B<brsp> using certificate B<signer>, private key
  43. B<key>, digest B<dgst> and additional certificates B<certs>. If the B<flags> option
  44. B<OCSP_NOCERTS> is set then no certificates will be included in the request. If the
  45. B<flags> option B<OCSP_RESPID_KEY> is set then the responder is identified by key ID
  46. rather than by name. OCSP_basic_sign_ctx() also signs OCSP response B<brsp> but
  47. uses the parameters contained in digest context B<ctx>.
  48. =head1 RETURN VALUES
  49. OCSP_RESPONSE_status() returns a status value.
  50. OCSP_response_get1_basic() returns an B<OCSP_BASICRESP> structure pointer or
  51. B<NULL> if an error occurred.
  52. OCSP_response_create() returns an B<OCSP_RESPONSE> structure pointer or B<NULL>
  53. if an error occurred.
  54. OCSP_RESPONSE_free() does not return a value.
  55. OCSP_RESPID_set_by_name(), OCSP_RESPID_set_by_key(), OCSP_basic_sign(), and
  56. OCSP_basic_sign_ctx() return 1 on success or 0
  57. on failure.
  58. OCSP_RESPID_match() returns 1 if the OCSP_RESPID and the X509 certificate match
  59. or 0 otherwise.
  60. =head1 NOTES
  61. OCSP_response_get1_basic() is only called if the status of a response is
  62. B<OCSP_RESPONSE_STATUS_SUCCESSFUL>.
  63. =head1 SEE ALSO
  64. L<crypto(7)>
  65. L<OCSP_cert_to_id(3)>
  66. L<OCSP_request_add1_nonce(3)>
  67. L<OCSP_REQUEST_new(3)>
  68. L<OCSP_resp_find_status(3)>
  69. L<OCSP_sendreq_new(3)>
  70. L<OCSP_RESPID_new(3)>
  71. L<OCSP_RESPID_free(3)>
  72. =head1 HISTORY
  73. The OCSP_RESPID_set_by_name(), OCSP_RESPID_set_by_key() and OCSP_RESPID_match()
  74. functions were added in OpenSSL 1.1.0a.
  75. The OCSP_basic_sign_ctx() function was added in OpenSSL 1.1.1.
  76. =head1 COPYRIGHT
  77. Copyright 2015-2018 The OpenSSL Project Authors. All Rights Reserved.
  78. Licensed under the OpenSSL license (the "License"). You may not use
  79. this file except in compliance with the License. You can obtain a copy
  80. in the file LICENSE in the source distribution or at
  81. L<https://www.openssl.org/source/license.html>.
  82. =cut