Constify X509|X509_CRL|X509_REVOKED_get_ext
[openssl.git] / doc / crypto / X509_dup.pod
1 =pod
2
3 =head1 NAME
4
5 DECLARE_ASN1_FUNCTIONS,
6 IMPLEMENT_ASN1_FUNCTIONS,
7 ASN1_ITEM,
8 ACCESS_DESCRIPTION_free,
9 ACCESS_DESCRIPTION_new,
10 ASIdOrRange_free,
11 ASIdOrRange_new,
12 ASIdentifierChoice_free,
13 ASIdentifierChoice_new,
14 ASIdentifiers_free,
15 ASIdentifiers_new,
16 ASRange_free,
17 ASRange_new,
18 AUTHORITY_INFO_ACCESS_free,
19 AUTHORITY_INFO_ACCESS_new,
20 AUTHORITY_KEYID_free,
21 AUTHORITY_KEYID_new,
22 BASIC_CONSTRAINTS_free,
23 BASIC_CONSTRAINTS_new,
24 CERTIFICATEPOLICIES_free,
25 CERTIFICATEPOLICIES_new,
26 CMS_ContentInfo_free,
27 CMS_ContentInfo_new,
28 CMS_ContentInfo_print_ctx,
29 CMS_ReceiptRequest_free,
30 CMS_ReceiptRequest_new,
31 CRL_DIST_POINTS_free,
32 CRL_DIST_POINTS_new,
33 DIRECTORYSTRING_free,
34 DIRECTORYSTRING_new,
35 DISPLAYTEXT_free,
36 DISPLAYTEXT_new,
37 DIST_POINT_NAME_free,
38 DIST_POINT_NAME_new,
39 DIST_POINT_free,
40 DIST_POINT_new,
41 DSAparams_dup,
42 EDIPARTYNAME_free,
43 EDIPARTYNAME_new,
44 ESS_CERT_ID_dup,
45 ESS_CERT_ID_free,
46 ESS_CERT_ID_new,
47 ESS_ISSUER_SERIAL_dup,
48 ESS_ISSUER_SERIAL_free,
49 ESS_ISSUER_SERIAL_new,
50 ESS_SIGNING_CERT_dup,
51 ESS_SIGNING_CERT_free,
52 ESS_SIGNING_CERT_new,
53 EXTENDED_KEY_USAGE_free,
54 EXTENDED_KEY_USAGE_new,
55 GENERAL_NAMES_free,
56 GENERAL_NAMES_new,
57 GENERAL_NAME_dup,
58 GENERAL_NAME_free,
59 GENERAL_NAME_new,
60 GENERAL_SUBTREE_free,
61 GENERAL_SUBTREE_new,
62 IPAddressChoice_free,
63 IPAddressChoice_new,
64 IPAddressFamily_free,
65 IPAddressFamily_new,
66 IPAddressOrRange_free,
67 IPAddressOrRange_new,
68 IPAddressRange_free,
69 IPAddressRange_new,
70 ISSUING_DIST_POINT_free,
71 ISSUING_DIST_POINT_new,
72 NAME_CONSTRAINTS_free,
73 NAME_CONSTRAINTS_new,
74 NETSCAPE_CERT_SEQUENCE_free,
75 NETSCAPE_CERT_SEQUENCE_new,
76 NETSCAPE_SPKAC_free,
77 NETSCAPE_SPKAC_new,
78 NETSCAPE_SPKI_free,
79 NETSCAPE_SPKI_new,
80 NOTICEREF_free,
81 NOTICEREF_new,
82 OCSP_BASICRESP_free,
83 OCSP_BASICRESP_new,
84 OCSP_CERTID_dup,
85 OCSP_CERTID_new,
86 OCSP_CERTSTATUS_free,
87 OCSP_CERTSTATUS_new,
88 OCSP_CRLID_free,
89 OCSP_CRLID_new,
90 OCSP_ONEREQ_free,
91 OCSP_ONEREQ_new,
92 OCSP_REQINFO_free,
93 OCSP_REQINFO_new,
94 OCSP_RESPBYTES_free,
95 OCSP_RESPBYTES_new,
96 OCSP_RESPDATA_free,
97 OCSP_RESPDATA_new,
98 OCSP_RESPID_free,
99 OCSP_RESPID_new,
100 OCSP_RESPONSE_new,
101 OCSP_REVOKEDINFO_free,
102 OCSP_REVOKEDINFO_new,
103 OCSP_SERVICELOC_free,
104 OCSP_SERVICELOC_new,
105 OCSP_SIGNATURE_free,
106 OCSP_SIGNATURE_new,
107 OCSP_SINGLERESP_free,
108 OCSP_SINGLERESP_new,
109 OTHERNAME_free,
110 OTHERNAME_new,
111 PBE2PARAM_free,
112 PBE2PARAM_new,
113 PBEPARAM_free,
114 PBEPARAM_new,
115 PBKDF2PARAM_free,
116 PBKDF2PARAM_new,
117 PKCS12_BAGS_free,
118 PKCS12_BAGS_new,
119 PKCS12_MAC_DATA_free,
120 PKCS12_MAC_DATA_new,
121 PKCS12_SAFEBAG_free,
122 PKCS12_SAFEBAG_new,
123 PKCS12_free,
124 PKCS12_new,
125 PKCS7_DIGEST_free,
126 PKCS7_DIGEST_new,
127 PKCS7_ENCRYPT_free,
128 PKCS7_ENCRYPT_new,
129 PKCS7_ENC_CONTENT_free,
130 PKCS7_ENC_CONTENT_new,
131 PKCS7_ENVELOPE_free,
132 PKCS7_ENVELOPE_new,
133 PKCS7_ISSUER_AND_SERIAL_free,
134 PKCS7_ISSUER_AND_SERIAL_new,
135 PKCS7_RECIP_INFO_free,
136 PKCS7_RECIP_INFO_new,
137 PKCS7_SIGNED_free,
138 PKCS7_SIGNED_new,
139 PKCS7_SIGNER_INFO_free,
140 PKCS7_SIGNER_INFO_new,
141 PKCS7_SIGN_ENVELOPE_free,
142 PKCS7_SIGN_ENVELOPE_new,
143 PKCS7_dup,
144 PKCS7_free,
145 PKCS7_new,
146 PKCS7_print_ctx,
147 PKCS8_PRIV_KEY_INFO_free,
148 PKCS8_PRIV_KEY_INFO_new,
149 PKEY_USAGE_PERIOD_free,
150 PKEY_USAGE_PERIOD_new,
151 POLICYINFO_free,
152 POLICYINFO_new,
153 POLICYQUALINFO_free,
154 POLICYQUALINFO_new,
155 POLICY_CONSTRAINTS_free,
156 POLICY_CONSTRAINTS_new,
157 POLICY_MAPPING_free,
158 POLICY_MAPPING_new,
159 PROXY_CERT_INFO_EXTENSION_free,
160 PROXY_CERT_INFO_EXTENSION_new,
161 PROXY_POLICY_free,
162 PROXY_POLICY_new,
163 RSAPrivateKey_dup,
164 RSAPublicKey_dup,
165 RSA_OAEP_PARAMS_free,
166 RSA_OAEP_PARAMS_new,
167 RSA_PSS_PARAMS_free,
168 RSA_PSS_PARAMS_new,
169 SCT_LIST_free,
170 SXNETID_free,
171 SXNETID_new,
172 SXNET_free,
173 SXNET_new,
174 TLS_FEATURE_free,
175 TLS_FEATURE_new,
176 TS_ACCURACY_dup,
177 TS_ACCURACY_free,
178 TS_ACCURACY_new,
179 TS_MSG_IMPRINT_dup,
180 TS_MSG_IMPRINT_free,
181 TS_MSG_IMPRINT_new,
182 TS_REQ_dup,
183 TS_REQ_free,
184 TS_REQ_new,
185 TS_RESP_dup,
186 TS_RESP_free,
187 TS_RESP_new,
188 TS_STATUS_INFO_dup,
189 TS_STATUS_INFO_free,
190 TS_STATUS_INFO_new,
191 TS_TST_INFO_dup,
192 TS_TST_INFO_free,
193 TS_TST_INFO_new,
194 USERNOTICE_free,
195 USERNOTICE_new,
196 X509_ALGOR_free,
197 X509_ALGOR_new,
198 X509_ATTRIBUTE_dup,
199 X509_ATTRIBUTE_free,
200 X509_ATTRIBUTE_new,
201 X509_CERT_AUX_free,
202 X509_CERT_AUX_new,
203 X509_CINF_free,
204 X509_CINF_new,
205 X509_CRL_INFO_free,
206 X509_CRL_INFO_new,
207 X509_CRL_METHOD_free,
208 X509_CRL_METHOD_new,
209 X509_CRL_dup,
210 X509_CRL_free,
211 X509_CRL_new,
212 X509_EXTENSION_dup,
213 X509_EXTENSION_free,
214 X509_EXTENSION_new,
215 X509_NAME_ENTRY_dup,
216 X509_NAME_ENTRY_free,
217 X509_NAME_ENTRY_new,
218 X509_NAME_dup,
219 X509_NAME_free,
220 X509_NAME_new,
221 X509_REQ_INFO_free,
222 X509_REQ_INFO_new,
223 X509_REQ_dup,
224 X509_REQ_free,
225 X509_REQ_new,
226 X509_REVOKED_dup,
227 X509_REVOKED_free,
228 X509_REVOKED_new,
229 X509_SIG_free,
230 X509_SIG_new,
231 X509_VAL_free,
232 X509_VAL_new,
233 X509_dup,
234 - ASN1 object utilities
235
236 =for comment generic
237
238 =head1 SYNOPSIS
239
240  #include <openssl/asn1t.h>
241
242  DECLARE_ASN1_FUNCTIONS(type)
243  IMPLEMENT_ASN1_FUNCTIONS(stname)
244
245  typedef struct ASN1_ITEM_st ASN1_ITEM;
246
247  extern const ASN1_ITEM TYPE_it;
248  TYPE *TYPE_new(void);
249  TYPE *TYPE_dup(TYPE *a);
250  void TYPE_free(TYPE *a);
251  int TYPE_print_ctx(BIO *out, TYPE *a, int indent, const ASN1_PCTX *pctx);
252
253 =head1 DESCRIPTION
254
255 In the description below, I<TYPE> is used
256 as a placeholder for any of the OpenSSL datatypes, such as I<X509>.
257
258 The OpenSSL ASN1 parsing library templates are like a data-driven bytecode
259 interpreter.
260 Every ASN1 object as a global variable, TYPE_it, that describes the item
261 such as its fields.  (On systems which cannot export variables from shared
262 libraries, the global is instead a function which returns a pointer to a
263 static variable.
264
265 The macro DECLARE_ASN1_FUNCTIONS() is typically used in header files
266 to generate the function declarations.
267
268 The macro IMPLEMENT_ASN1_FUNCTIONS() is used once in a source file
269 to generate the function bodies.
270
271
272 TYPE_new() allocates an empty object of the indicated type.
273 The object returned must be released by calling TYPE_free().
274
275 TYPE_dup() copies an existing object.
276
277 TYPE_free() releases the object and all pointers and sub-objects
278 within it.
279
280 TYPE_print_ctx() prints the object B<a> on the specified BIO B<out>.
281 Each line will be prefixed with B<indent> spaces.
282 The B<pctx> specifies the printing context and is for internal
283 use; use NULL to get the default behavior.  If a print function is
284 user-defined, then pass in any B<pctx> down to any nested calls.
285
286 =head1 RETURN VALUES
287
288 TYPE_new() and TYPE_dup() return a pointer to the object or NULL on failure.
289
290 TYPE_print_ctx() returns 1 on success or zero on failure.
291
292 =head1 COPYRIGHT
293
294 Copyright 2016 The OpenSSL Project Authors. All Rights Reserved.
295
296 Licensed under the OpenSSL license (the "License").  You may not use
297 this file except in compliance with the License.  You can obtain a copy
298 in the file LICENSE in the source distribution or at
299 L<https://www.openssl.org/source/license.html>.
300
301 =cut