Debian Codegraph @

upstream/debian-unstable/man3/OCSP_cert_to_id.3ssl

raw
1 .\" -*- mode: troff; coding: utf-8 -*-
2 .\" Automatically generated by Pod::Man 5.0102 (Pod::Simple 3.45)
3 .\"
4 .\" Standard preamble:
5 .\" ========================================================================
6 .de Sp \" Vertical space (when we can't use .PP)
7 .if t .sp .5v
8 .if n .sp
9 ..
10 .de Vb \" Begin verbatim text
11 .ft CW
12 .nf
13 .ne \\$1
14 ..
15 .de Ve \" End verbatim text
16 .ft R
17 .fi
18 ..
19 .\" \*(C` and \*(C' are quotes in nroff, nothing in troff, for use with C<>.
20 .ie n \{\
21 . ds C` ""
22 . ds C' ""
23 'br\}
24 .el\{\
25 . ds C`
26 . ds C'
27 'br\}
28 .\"
29 .\" Escape single quotes in literal strings from groff's Unicode transform.
30 .ie \n(.g .ds Aq \(aq
31 .el .ds Aq '
32 .\"
33 .\" If the F register is >0, we'll generate index entries on stderr for
34 .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index
35 .\" entries marked with X<> in POD. Of course, you'll have to process the
36 .\" output yourself in some meaningful fashion.
37 .\"
38 .\" Avoid warning from groff about undefined register 'F'.
39 .de IX
40 ..
41 .nr rF 0
42 .if \n(.g .if rF .nr rF 1
43 .if (\n(rF:(\n(.g==0)) \{\
44 . if \nF \{\
45 . de IX
46 . tm Index:\\$1\t\\n%\t"\\$2"
47 ..
48 . if !\nF==2 \{\
49 . nr % 0
50 . nr F 2
51 . \}
52 . \}
53 .\}
54 .rr rF
55 .\" ========================================================================
56 .\"
57 .IX Title "OCSP_CERT_TO_ID 3SSL"
58 .TH OCSP_CERT_TO_ID 3SSL 2026-04-07 3.6.2 OpenSSL
59 .\" For nroff, turn off justification. Always turn off hyphenation; it makes
60 .\" way too many mistakes in technical documents.
61 .if n .ad l
62 .nh
63 .SH NAME
64 OCSP_cert_to_id, OCSP_cert_id_new, OCSP_CERTID_free, OCSP_id_issuer_cmp,
65 OCSP_id_cmp, OCSP_id_get0_info \- OCSP certificate ID utility functions
66 .SH SYNOPSIS
67 .IX Header "SYNOPSIS"
68 .Vb 1
69 \& #include <openssl/ocsp.h>
70 \&
71 \& OCSP_CERTID *OCSP_cert_to_id(const EVP_MD *dgst,
72 \& X509 *subject, X509 *issuer);
73 \&
74 \& OCSP_CERTID *OCSP_cert_id_new(const EVP_MD *dgst,
75 \& X509_NAME *issuerName,
76 \& ASN1_BIT_STRING *issuerKey,
77 \& ASN1_INTEGER *serialNumber);
78 \&
79 \& void OCSP_CERTID_free(OCSP_CERTID *id);
80 \&
81 \& int OCSP_id_issuer_cmp(const OCSP_CERTID *a, const OCSP_CERTID *b);
82 \& int OCSP_id_cmp(const OCSP_CERTID *a, const OCSP_CERTID *b);
83 \&
84 \& int OCSP_id_get0_info(ASN1_OCTET_STRING **piNameHash, ASN1_OBJECT **pmd,
85 \& ASN1_OCTET_STRING **pikeyHash,
86 \& ASN1_INTEGER **pserial, OCSP_CERTID *cid);
87 .Ve
88 .SH DESCRIPTION
89 .IX Header "DESCRIPTION"
90 \&\fBOCSP_cert_to_id()\fR creates and returns a new \fBOCSP_CERTID\fR structure using
91 message digest \fBdgst\fR for certificate \fBsubject\fR with issuer \fBissuer\fR. If
92 \&\fBdgst\fR is \fBNULL\fR then SHA1 is used.
93 .PP
94 \&\fBOCSP_cert_id_new()\fR creates and returns a new \fBOCSP_CERTID\fR using \fBdgst\fR and
95 issuer name \fBissuerName\fR, issuer key hash \fBissuerKey\fR and serial number
96 \&\fBserialNumber\fR.
97 .PP
98 \&\fBOCSP_CERTID_free()\fR frees up \fBid\fR.
99 If the argument is NULL, nothing is done.
100 .PP
101 \&\fBOCSP_id_cmp()\fR compares \fBOCSP_CERTID\fR \fBa\fR and \fBb\fR.
102 .PP
103 \&\fBOCSP_id_issuer_cmp()\fR compares only the issuer name of \fBOCSP_CERTID\fR \fBa\fR and \fBb\fR.
104 .PP
105 \&\fBOCSP_id_get0_info()\fR returns the issuer name hash, hash OID, issuer key hash and
106 serial number contained in \fBcid\fR. If any of the values are not required the
107 corresponding parameter can be set to \fBNULL\fR.
108 .SH "RETURN VALUES"
109 .IX Header "RETURN VALUES"
110 \&\fBOCSP_cert_to_id()\fR and \fBOCSP_cert_id_new()\fR return either a pointer to a valid
111 \&\fBOCSP_CERTID\fR structure or \fBNULL\fR if an error occurred.
112 .PP
113 \&\fBOCSP_id_cmp()\fR and \fBOCSP_id_issuer_cmp()\fR returns zero for a match and nonzero
114 otherwise.
115 .PP
116 \&\fBOCSP_CERTID_free()\fR does not return a value.
117 .PP
118 \&\fBOCSP_id_get0_info()\fR returns 1 for success and 0 for failure.
119 .SH NOTES
120 .IX Header "NOTES"
121 OCSP clients will typically only use \fBOCSP_cert_to_id()\fR or \fBOCSP_cert_id_new()\fR:
122 the other functions are used by responder applications.
123 .PP
124 The values returned by \fBOCSP_id_get0_info()\fR are internal pointers and \fBMUST
125 NOT\fR be freed up by an application: they will be freed when the corresponding
126 \&\fBOCSP_CERTID\fR structure is freed.
127 .SH "SEE ALSO"
128 .IX Header "SEE ALSO"
129 \&\fBcrypto\fR\|(7),
130 \&\fBOCSP_request_add1_nonce\fR\|(3),
131 \&\fBOCSP_REQUEST_new\fR\|(3),
132 \&\fBOCSP_resp_find_status\fR\|(3),
133 \&\fBOCSP_response_status\fR\|(3),
134 \&\fBOCSP_sendreq_new\fR\|(3)
135 .SH COPYRIGHT
136 .IX Header "COPYRIGHT"
137 Copyright 2015\-2024 The OpenSSL Project Authors. All Rights Reserved.
138 .PP
139 Licensed under the Apache License 2.0 (the "License"). You may not use
140 this file except in compliance with the License. You can obtain a copy
141 in the file LICENSE in the source distribution or at
142 <https://www.openssl.org/source/license.html>.