summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/man/X509_OBJECT_get0_X509.3
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/libcrypto/man/X509_OBJECT_get0_X509.3')
-rw-r--r--src/lib/libcrypto/man/X509_OBJECT_get0_X509.3253
1 files changed, 0 insertions, 253 deletions
diff --git a/src/lib/libcrypto/man/X509_OBJECT_get0_X509.3 b/src/lib/libcrypto/man/X509_OBJECT_get0_X509.3
deleted file mode 100644
index ef3dbd1bba..0000000000
--- a/src/lib/libcrypto/man/X509_OBJECT_get0_X509.3
+++ /dev/null
@@ -1,253 +0,0 @@
1.\" $OpenBSD: X509_OBJECT_get0_X509.3,v 1.11 2021/08/02 16:21:11 schwarze Exp $
2.\" Copyright (c) 2018 Ingo Schwarze <schwarze@openbsd.org>
3.\"
4.\" Permission to use, copy, modify, and distribute this software for any
5.\" purpose with or without fee is hereby granted, provided that the above
6.\" copyright notice and this permission notice appear in all copies.
7.\"
8.\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
9.\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
10.\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
11.\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
12.\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
13.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
14.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
15.\"
16.Dd $Mdocdate: August 2 2021 $
17.Dt X509_OBJECT_GET0_X509 3
18.Os
19.Sh NAME
20.Nm X509_OBJECT_get_type ,
21.Nm X509_OBJECT_up_ref_count ,
22.Nm X509_OBJECT_free_contents ,
23.Nm X509_OBJECT_get0_X509 ,
24.Nm X509_OBJECT_get0_X509_CRL ,
25.Nm X509_OBJECT_idx_by_subject ,
26.Nm X509_OBJECT_retrieve_by_subject ,
27.Nm X509_OBJECT_retrieve_match
28.Nd certificate, CRL, private key, and string wrapper for certificate stores
29.Sh SYNOPSIS
30.In openssl/x509_vfy.h
31.Ft int
32.Fo X509_OBJECT_get_type
33.Fa "const X509_OBJECT *obj"
34.Fc
35.Ft int
36.Fo X509_OBJECT_up_ref_count
37.Fa "X509_OBJECT *obj"
38.Fc
39.Ft void
40.Fo X509_OBJECT_free_contents
41.Fa "X509_OBJECT *obj"
42.Fc
43.Ft X509 *
44.Fo X509_OBJECT_get0_X509
45.Fa "const X509_OBJECT *obj"
46.Fc
47.Ft X509_CRL *
48.Fo X509_OBJECT_get0_X509_CRL
49.Fa "X509_OBJECT *obj"
50.Fc
51.Ft int
52.Fo X509_OBJECT_idx_by_subject
53.Fa "STACK_OF(X509_OBJECT) *stack"
54.Fa "int type"
55.Fa "X509_NAME *name"
56.Fc
57.Ft X509_OBJECT *
58.Fo X509_OBJECT_retrieve_by_subject
59.Fa "STACK_OF(X509_OBJECT) *stack"
60.Fa "int type"
61.Fa "X509_NAME *name"
62.Fc
63.Ft X509_OBJECT *
64.Fo X509_OBJECT_retrieve_match
65.Fa "STACK_OF(X509_OBJECT) *stack"
66.Fa "X509_OBJECT *obj"
67.Fc
68.Sh DESCRIPTION
69The
70.Vt X509_OBJECT
71structure is a shallow wrapper around one
72.Vt X509
73certificate object, one
74.Vt X509_CRL
75certificate revocation list object, one
76.Vt EVP_PKEY
77private key object, or one
78.Vt char *
79string.
80The type of object stored at any given time can be inspected with
81.Fn X509_OBJECT_get_type .
82.Pp
83Each
84.Vt X509_STORE
85object uses one stack of
86.Vt X509_OBJECT
87structures as its main storage area.
88.Pp
89If
90.Fa obj
91contains an
92.Vt X509
93certificate or an
94.Vt X509_CRL
95certificate revocation list,
96.Fn X509_OBJECT_up_ref_count
97increments the reference count of that inner object by 1.
98Otherwise, no action occurs.
99.Pp
100If
101.Fa obj
102contains an
103.Vt X509
104certificate,
105.Fn X509_OBJECT_free_contents
106calls
107.Xr X509_free 3
108on that inner object.
109If
110.Fa obj
111contains an
112.Vt X509_CRL
113certificate revocation list, it calls
114.Xr X509_CRL_free 3
115on that inner list.
116Otherwise, no action occurs.
117.Fn X509_OBJECT_free_contents
118does not free
119.Fa obj
120itself.
121.Pp
122If
123.Fa type
124is
125.Dv X509_LU_X509 ,
126.Fn X509_OBJECT_idx_by_subject
127and
128.Fn X509_OBJECT_retrieve_by_subject
129search the given
130.Fa stack
131for a certificate with the subject
132.Fa name .
133If
134.Fa type
135is
136.Dv X509_LU_CRL ,
137they search for a certificate revocation list with the issuer
138.Fa name
139instead.
140.Pp
141If
142.Fa obj
143contains a certificate,
144.Fn X509_OBJECT_retrieve_match
145searches the given
146.Fa stack
147for a certificate with a matching subject name;
148if it contains a certificate revocation list, it searches for a
149certificate revocation list with a matching issuer name instead;
150otherwise, it searches for an
151.Vt X509_OBJECT
152with a matching type.
153.Sh RETURN VALUES
154.Fn X509_OBJECT_get_type
155returns
156.Dv X509_LU_X509
157if
158.Fa obj
159contains a certificate,
160.Dv X509_LU_CRL
161if it contains a certificate revocation list,
162or 0 if an error occurs.
163.Pp
164.Fn X509_OBJECT_up_ref_count
165returns 1 on success and 0 on failure.
166.Pp
167.Fn X509_OBJECT_get0_X509
168returns an internal pointer to the certificate contained in
169.Fa obj
170or
171.Dv NULL
172if
173.Fa obj
174is
175.Dv NULL
176or contains no certificate.
177.Pp
178.Fn X509_OBJECT_get0_X509_CRL
179returns an internal pointer to the certificate revocation list contained in
180.Fa obj
181or
182.Dv NULL
183if
184.Fa obj
185is
186.Dv NULL
187or contains no certificate revocation list.
188.Pp
189.Fn X509_OBJECT_idx_by_subject
190returns the zero-based index of the first matching certificate
191or revocation list in the
192.Fa stack
193or \-1 if
194.Fa type
195is neither
196.Dv X509_LU_X509
197nor
198.Dv X509_LU_CRL
199or if no match is found.
200.Pp
201.Fn X509_OBJECT_retrieve_by_subject
202returns the first matching certificate or revocation list in the
203.Fa stack
204or
205.Dv NULL
206if
207.Fa type
208is neither
209.Dv X509_LU_X509
210nor
211.Dv X509_LU_CRL
212or if no match is found.
213.Pp
214.Fn X509_OBJECT_retrieve_match
215returns the first mathching
216.Vt X509_OBJECT
217or
218.Dv NULL
219if
220.Fa stack
221or
222.Fa obj
223is
224.Dv NULL
225or no match is found.
226.Sh SEE ALSO
227.Xr X509_CRL_new 3 ,
228.Xr X509_LOOKUP_new 3 ,
229.Xr X509_NAME_new 3 ,
230.Xr X509_STORE_get0_objects 3 ,
231.Xr X509_STORE_get_by_subject 3 ,
232.Xr X509_STORE_load_locations 3 ,
233.Xr X509_STORE_new 3
234.Sh HISTORY
235.Fn X509_OBJECT_up_ref_count
236and
237.Fn X509_OBJECT_free_contents
238first appeared in SSLeay 0.8.0 and have been available since
239.Ox 2.4 .
240.Pp
241.Fn X509_OBJECT_idx_by_subject ,
242.Fn X509_OBJECT_retrieve_by_subject ,
243and
244.Fn X509_OBJECT_retrieve_match
245first appeared in OpenSSL 0.9.6 and have been available since
246.Ox 2.9 .
247.Pp
248.Fn X509_OBJECT_get_type ,
249.Fn X509_OBJECT_get0_X509 ,
250and
251.Fn X509_OBJECT_get0_X509_CRL
252first appeared in OpenSSL 1.1.0 and have been available since
253.Ox 6.3 .