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