2
0

OCSP_cert_to_id.pod 2.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  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. OCSP_id_cmp() compares B<OCSP_CERTID> B<a> and B<b>.
  28. OCSP_id_issuer_cmp() compares only the issuer name of B<OCSP_CERTID> B<a> and B<b>.
  29. OCSP_id_get0_info() returns the issuer name hash, hash OID, issuer key hash and
  30. serial number contained in B<cid>. If any of the values are not required the
  31. corresponding parameter can be set to B<NULL>.
  32. =head1 RETURN VALUES
  33. OCSP_cert_to_id() and OCSP_cert_id_new() return either a pointer to a valid
  34. B<OCSP_CERTID> structure or B<NULL> if an error occurred.
  35. OCSP_id_cmp() and OCSP_id_issuer_cmp() returns zero for a match and nonzero
  36. otherwise.
  37. OCSP_CERTID_free() does not return a value.
  38. OCSP_id_get0_info() returns 1 for success and 0 for failure.
  39. =head1 NOTES
  40. OCSP clients will typically only use OCSP_cert_to_id() or OCSP_cert_id_new():
  41. the other functions are used by responder applications.
  42. The values returned by OCSP_id_get0_info() are internal pointers and B<MUST
  43. NOT> be freed up by an application: they will be freed when the corresponding
  44. B<OCSP_CERTID> structure is freed.
  45. =head1 SEE ALSO
  46. L<crypto(7)>,
  47. L<OCSP_request_add1_nonce(3)>,
  48. L<OCSP_REQUEST_new(3)>,
  49. L<OCSP_resp_find_status(3)>,
  50. L<OCSP_response_status(3)>,
  51. L<OCSP_sendreq_new(3)>
  52. =head1 COPYRIGHT
  53. Copyright 2015-2016 The OpenSSL Project Authors. All Rights Reserved.
  54. Licensed under the Apache License 2.0 (the "License"). You may not use
  55. this file except in compliance with the License. You can obtain a copy
  56. in the file LICENSE in the source distribution or at
  57. L<https://www.openssl.org/source/license.html>.
  58. =cut