OCSP_cert_to_id.pod 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. =pod
  2. =head1 NAME
  3. OCSP_cert_to_id, OCSP_cert_id_new, OCSP_CERTID_free, OCSP_id_issuer_cmp,
  4. OCSP_id_cmp, OCSP_id_get0_info - OCSP certificate ID utility functions
  5. =head1 SYNOPSIS
  6. #include <openssl/ocsp.h>
  7. OCSP_CERTID *OCSP_cert_to_id(const EVP_MD *dgst,
  8. X509 *subject, X509 *issuer);
  9. OCSP_CERTID *OCSP_cert_id_new(const EVP_MD *dgst,
  10. X509_NAME *issuerName,
  11. ASN1_BIT_STRING *issuerKey,
  12. ASN1_INTEGER *serialNumber);
  13. void OCSP_CERTID_free(OCSP_CERTID *id);
  14. int OCSP_id_issuer_cmp(const OCSP_CERTID *a, const OCSP_CERTID *b);
  15. int OCSP_id_cmp(const OCSP_CERTID *a, const OCSP_CERTID *b);
  16. int OCSP_id_get0_info(ASN1_OCTET_STRING **piNameHash, ASN1_OBJECT **pmd,
  17. ASN1_OCTET_STRING **pikeyHash,
  18. ASN1_INTEGER **pserial, OCSP_CERTID *cid);
  19. =head1 DESCRIPTION
  20. OCSP_cert_to_id() creates and returns a new B<OCSP_CERTID> structure using
  21. message digest B<dgst> for certificate B<subject> with issuer B<issuer>. If
  22. B<dgst> is B<NULL> then SHA1 is used.
  23. OCSP_cert_id_new() creates and returns a new B<OCSP_CERTID> using B<dgst> and
  24. issuer name B<issuerName>, issuer key hash B<issuerKey> and serial number
  25. B<serialNumber>.
  26. OCSP_CERTID_free() frees up B<id>.
  27. If the argument is NULL, nothing is done.
  28. OCSP_id_cmp() compares B<OCSP_CERTID> B<a> and B<b>.
  29. OCSP_id_issuer_cmp() compares only the issuer name of B<OCSP_CERTID> B<a> and B<b>.
  30. OCSP_id_get0_info() returns the issuer name hash, hash OID, issuer key hash and
  31. serial number contained in B<cid>. If any of the values are not required the
  32. corresponding parameter can be set to B<NULL>.
  33. =head1 RETURN VALUES
  34. OCSP_cert_to_id() and OCSP_cert_id_new() return either a pointer to a valid
  35. B<OCSP_CERTID> structure or B<NULL> if an error occurred.
  36. OCSP_id_cmp() and OCSP_id_issuer_cmp() returns zero for a match and nonzero
  37. otherwise.
  38. OCSP_CERTID_free() does not return a value.
  39. OCSP_id_get0_info() returns 1 for success and 0 for failure.
  40. =head1 NOTES
  41. OCSP clients will typically only use OCSP_cert_to_id() or OCSP_cert_id_new():
  42. the other functions are used by responder applications.
  43. The values returned by OCSP_id_get0_info() are internal pointers and B<MUST
  44. NOT> be freed up by an application: they will be freed when the corresponding
  45. B<OCSP_CERTID> structure is freed.
  46. =head1 SEE ALSO
  47. L<crypto(7)>,
  48. L<OCSP_request_add1_nonce(3)>,
  49. L<OCSP_REQUEST_new(3)>,
  50. L<OCSP_resp_find_status(3)>,
  51. L<OCSP_response_status(3)>,
  52. L<OCSP_sendreq_new(3)>
  53. =head1 COPYRIGHT
  54. Copyright 2015-2024 The OpenSSL Project Authors. All Rights Reserved.
  55. Licensed under the Apache License 2.0 (the "License"). You may not use
  56. this file except in compliance with the License. You can obtain a copy
  57. in the file LICENSE in the source distribution or at
  58. L<https://www.openssl.org/source/license.html>.
  59. =cut