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