8226983d5d0fd18e21730d35c279d8e3e7966f82
[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 SXNETID_free,
174 SXNETID_new,
175 SXNET_free,
176 SXNET_new,
177 TLS_FEATURE_free,
178 TLS_FEATURE_new,
179 TS_ACCURACY_dup,
180 TS_ACCURACY_free,
181 TS_ACCURACY_new,
182 TS_MSG_IMPRINT_dup,
183 TS_MSG_IMPRINT_free,
184 TS_MSG_IMPRINT_new,
185 TS_REQ_dup,
186 TS_REQ_free,
187 TS_REQ_new,
188 TS_RESP_dup,
189 TS_RESP_free,
190 TS_RESP_new,
191 TS_STATUS_INFO_dup,
192 TS_STATUS_INFO_free,
193 TS_STATUS_INFO_new,
194 TS_TST_INFO_dup,
195 TS_TST_INFO_free,
196 TS_TST_INFO_new,
197 USERNOTICE_free,
198 USERNOTICE_new,
199 X509_ALGOR_free,
200 X509_ALGOR_new,
201 X509_ATTRIBUTE_dup,
202 X509_ATTRIBUTE_free,
203 X509_ATTRIBUTE_new,
204 X509_CERT_AUX_free,
205 X509_CERT_AUX_new,
206 X509_CINF_free,
207 X509_CINF_new,
208 X509_CRL_INFO_free,
209 X509_CRL_INFO_new,
210 X509_CRL_dup,
211 X509_CRL_free,
212 X509_CRL_new,
213 X509_EXTENSION_dup,
214 X509_EXTENSION_free,
215 X509_EXTENSION_new,
216 X509_NAME_ENTRY_dup,
217 X509_NAME_ENTRY_free,
218 X509_NAME_ENTRY_new,
219 X509_NAME_dup,
220 X509_NAME_free,
221 X509_NAME_new,
222 X509_REQ_INFO_free,
223 X509_REQ_INFO_new,
224 X509_REQ_dup,
225 X509_REQ_free,
226 X509_REQ_new,
227 X509_REVOKED_dup,
228 X509_REVOKED_free,
229 X509_REVOKED_new,
230 X509_SIG_free,
231 X509_SIG_new,
232 X509_VAL_free,
233 X509_VAL_new,
234 X509_dup,
235 - ASN1 object utilities
236
237 =head1 SYNOPSIS
238
239 =for comment generic
240
241  #include <openssl/asn1t.h>
242
243  DECLARE_ASN1_FUNCTIONS(type)
244  IMPLEMENT_ASN1_FUNCTIONS(stname)
245
246  typedef struct ASN1_ITEM_st ASN1_ITEM;
247
248  extern const ASN1_ITEM TYPE_it;
249  TYPE *TYPE_new(void);
250  TYPE *TYPE_dup(TYPE *a);
251  void TYPE_free(TYPE *a);
252  int TYPE_print_ctx(BIO *out, TYPE *a, int indent, const ASN1_PCTX *pctx);
253
254 =head1 DESCRIPTION
255
256 In the description below, I<TYPE> is used
257 as a placeholder for any of the OpenSSL datatypes, such as I<X509>.
258
259 The OpenSSL ASN1 parsing library templates are like a data-driven bytecode
260 interpreter.
261 Every ASN1 object as a global variable, TYPE_it, that describes the item
262 such as its fields.  (On systems which cannot export variables from shared
263 libraries, the global is instead a function which returns a pointer to a
264 static variable.
265
266 The macro DECLARE_ASN1_FUNCTIONS() is typically used in header files
267 to generate the function declarations.
268
269 The macro IMPLEMENT_ASN1_FUNCTIONS() is used once in a source file
270 to generate the function bodies.
271
272
273 TYPE_new() allocates an empty object of the indicated type.
274 The object returned must be released by calling TYPE_free().
275
276 TYPE_dup() copies an existing object.
277
278 TYPE_free() releases the object and all pointers and sub-objects
279 within it.
280
281 TYPE_print_ctx() prints the object B<a> on the specified BIO B<out>.
282 Each line will be prefixed with B<indent> spaces.
283 The B<pctx> specifies the printing context and is for internal
284 use; use NULL to get the default behavior.  If a print function is
285 user-defined, then pass in any B<pctx> down to any nested calls.
286
287 =head1 RETURN VALUES
288
289 TYPE_new() and TYPE_dup() return a pointer to the object or NULL on failure.
290
291 TYPE_print_ctx() returns 1 on success or zero on failure.
292
293 =head1 COPYRIGHT
294
295 Copyright 2016 The OpenSSL Project Authors. All Rights Reserved.
296
297 Licensed under the OpenSSL license (the "License").  You may not use
298 this file except in compliance with the License.  You can obtain a copy
299 in the file LICENSE in the source distribution or at
300 L<https://www.openssl.org/source/license.html>.
301
302 =cut