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