]> git.ipfire.org Git - thirdparty/openssl.git/blame - doc/man3/X509_dup.pod
Implement EVP_PKEY_dup() function
[thirdparty/openssl.git] / doc / man3 / X509_dup.pod
CommitLineData
12ce9ea2
RS
1=pod
2
3=head1 NAME
4
5DECLARE_ASN1_FUNCTIONS,
6IMPLEMENT_ASN1_FUNCTIONS,
7ASN1_ITEM,
8ACCESS_DESCRIPTION_free,
9ACCESS_DESCRIPTION_new,
fa743582
RS
10ADMISSIONS_free,
11ADMISSIONS_new,
12ADMISSION_SYNTAX_free,
13ADMISSION_SYNTAX_new,
12ce9ea2
RS
14ASIdOrRange_free,
15ASIdOrRange_new,
16ASIdentifierChoice_free,
17ASIdentifierChoice_new,
18ASIdentifiers_free,
19ASIdentifiers_new,
20ASRange_free,
21ASRange_new,
22AUTHORITY_INFO_ACCESS_free,
23AUTHORITY_INFO_ACCESS_new,
24AUTHORITY_KEYID_free,
25AUTHORITY_KEYID_new,
26BASIC_CONSTRAINTS_free,
27BASIC_CONSTRAINTS_new,
28CERTIFICATEPOLICIES_free,
29CERTIFICATEPOLICIES_new,
30CMS_ContentInfo_free,
31CMS_ContentInfo_new,
d8652be0 32CMS_ContentInfo_new_ex,
12ce9ea2
RS
33CMS_ContentInfo_print_ctx,
34CMS_ReceiptRequest_free,
35CMS_ReceiptRequest_new,
36CRL_DIST_POINTS_free,
37CRL_DIST_POINTS_new,
38DIRECTORYSTRING_free,
39DIRECTORYSTRING_new,
40DISPLAYTEXT_free,
41DISPLAYTEXT_new,
42DIST_POINT_NAME_free,
43DIST_POINT_NAME_new,
44DIST_POINT_free,
45DIST_POINT_new,
46DSAparams_dup,
9ba6f347
KY
47ECPARAMETERS_free,
48ECPARAMETERS_new,
49ECPKPARAMETERS_free,
50ECPKPARAMETERS_new,
12ce9ea2
RS
51EDIPARTYNAME_free,
52EDIPARTYNAME_new,
53ESS_CERT_ID_dup,
54ESS_CERT_ID_free,
55ESS_CERT_ID_new,
8c00f267
F
56ESS_CERT_ID_V2_dup,
57ESS_CERT_ID_V2_free,
58ESS_CERT_ID_V2_new,
12ce9ea2
RS
59ESS_ISSUER_SERIAL_dup,
60ESS_ISSUER_SERIAL_free,
61ESS_ISSUER_SERIAL_new,
62ESS_SIGNING_CERT_dup,
63ESS_SIGNING_CERT_free,
64ESS_SIGNING_CERT_new,
8c00f267
F
65ESS_SIGNING_CERT_V2_dup,
66ESS_SIGNING_CERT_V2_free,
67ESS_SIGNING_CERT_V2_new,
12ce9ea2
RS
68EXTENDED_KEY_USAGE_free,
69EXTENDED_KEY_USAGE_new,
70GENERAL_NAMES_free,
71GENERAL_NAMES_new,
72GENERAL_NAME_dup,
73GENERAL_NAME_free,
74GENERAL_NAME_new,
75GENERAL_SUBTREE_free,
76GENERAL_SUBTREE_new,
77IPAddressChoice_free,
78IPAddressChoice_new,
79IPAddressFamily_free,
80IPAddressFamily_new,
81IPAddressOrRange_free,
82IPAddressOrRange_new,
83IPAddressRange_free,
84IPAddressRange_new,
d9321c09
NM
85ISSUER_SIGN_TOOL_free,
86ISSUER_SIGN_TOOL_it,
87ISSUER_SIGN_TOOL_new,
12ce9ea2 88ISSUING_DIST_POINT_free,
d9321c09 89ISSUING_DIST_POINT_it,
12ce9ea2
RS
90ISSUING_DIST_POINT_new,
91NAME_CONSTRAINTS_free,
92NAME_CONSTRAINTS_new,
fa743582
RS
93NAMING_AUTHORITY_free,
94NAMING_AUTHORITY_new,
12ce9ea2
RS
95NETSCAPE_CERT_SEQUENCE_free,
96NETSCAPE_CERT_SEQUENCE_new,
97NETSCAPE_SPKAC_free,
98NETSCAPE_SPKAC_new,
99NETSCAPE_SPKI_free,
100NETSCAPE_SPKI_new,
101NOTICEREF_free,
102NOTICEREF_new,
103OCSP_BASICRESP_free,
104OCSP_BASICRESP_new,
105OCSP_CERTID_dup,
106OCSP_CERTID_new,
107OCSP_CERTSTATUS_free,
108OCSP_CERTSTATUS_new,
109OCSP_CRLID_free,
110OCSP_CRLID_new,
111OCSP_ONEREQ_free,
112OCSP_ONEREQ_new,
113OCSP_REQINFO_free,
114OCSP_REQINFO_new,
115OCSP_RESPBYTES_free,
116OCSP_RESPBYTES_new,
117OCSP_RESPDATA_free,
118OCSP_RESPDATA_new,
119OCSP_RESPID_free,
120OCSP_RESPID_new,
121OCSP_RESPONSE_new,
122OCSP_REVOKEDINFO_free,
123OCSP_REVOKEDINFO_new,
124OCSP_SERVICELOC_free,
125OCSP_SERVICELOC_new,
126OCSP_SIGNATURE_free,
127OCSP_SIGNATURE_new,
128OCSP_SINGLERESP_free,
129OCSP_SINGLERESP_new,
62dcd2aa 130OSSL_CMP_ITAV_dup,
8869ad4a 131OSSL_CMP_ITAV_free,
62dcd2aa 132OSSL_CMP_MSG_dup,
227d4265 133OSSL_CMP_MSG_it,
7960dbec 134OSSL_CMP_MSG_free,
8869ad4a
AK
135OSSL_CMP_PKIHEADER_free,
136OSSL_CMP_PKIHEADER_it,
137OSSL_CMP_PKIHEADER_new,
62dcd2aa 138OSSL_CMP_PKISI_dup,
8869ad4a 139OSSL_CMP_PKISI_free,
62dcd2aa 140OSSL_CMP_PKISI_it,
7960dbec 141OSSL_CMP_PKISI_new,
8869ad4a 142OSSL_CMP_PKISTATUS_it,
e197158b 143OSSL_CRMF_CERTID_dup,
2a3b52ea 144OSSL_CRMF_CERTID_free,
8869ad4a 145OSSL_CRMF_CERTID_it,
2a3b52ea
DO
146OSSL_CRMF_CERTID_new,
147OSSL_CRMF_CERTTEMPLATE_free,
8869ad4a 148OSSL_CRMF_CERTTEMPLATE_it,
2a3b52ea
DO
149OSSL_CRMF_CERTTEMPLATE_new,
150OSSL_CRMF_ENCRYPTEDVALUE_free,
8869ad4a 151OSSL_CRMF_ENCRYPTEDVALUE_it,
2a3b52ea 152OSSL_CRMF_ENCRYPTEDVALUE_new,
8869ad4a
AK
153OSSL_CRMF_MSGS_free,
154OSSL_CRMF_MSGS_it,
155OSSL_CRMF_MSGS_new,
299e0f1e 156OSSL_CRMF_MSG_dup,
2a3b52ea 157OSSL_CRMF_MSG_free,
8869ad4a 158OSSL_CRMF_MSG_it,
2a3b52ea
DO
159OSSL_CRMF_MSG_new,
160OSSL_CRMF_PBMPARAMETER_free,
8869ad4a 161OSSL_CRMF_PBMPARAMETER_it,
2a3b52ea
DO
162OSSL_CRMF_PBMPARAMETER_new,
163OSSL_CRMF_PKIPUBLICATIONINFO_free,
8869ad4a 164OSSL_CRMF_PKIPUBLICATIONINFO_it,
2a3b52ea 165OSSL_CRMF_PKIPUBLICATIONINFO_new,
8869ad4a
AK
166OSSL_CRMF_SINGLEPUBINFO_free,
167OSSL_CRMF_SINGLEPUBINFO_it,
168OSSL_CRMF_SINGLEPUBINFO_new,
12ce9ea2
RS
169OTHERNAME_free,
170OTHERNAME_new,
171PBE2PARAM_free,
172PBE2PARAM_new,
173PBEPARAM_free,
174PBEPARAM_new,
175PBKDF2PARAM_free,
176PBKDF2PARAM_new,
177PKCS12_BAGS_free,
178PKCS12_BAGS_new,
179PKCS12_MAC_DATA_free,
180PKCS12_MAC_DATA_new,
181PKCS12_SAFEBAG_free,
182PKCS12_SAFEBAG_new,
183PKCS12_free,
184PKCS12_new,
185PKCS7_DIGEST_free,
186PKCS7_DIGEST_new,
187PKCS7_ENCRYPT_free,
188PKCS7_ENCRYPT_new,
189PKCS7_ENC_CONTENT_free,
190PKCS7_ENC_CONTENT_new,
191PKCS7_ENVELOPE_free,
192PKCS7_ENVELOPE_new,
193PKCS7_ISSUER_AND_SERIAL_free,
194PKCS7_ISSUER_AND_SERIAL_new,
195PKCS7_RECIP_INFO_free,
196PKCS7_RECIP_INFO_new,
197PKCS7_SIGNED_free,
198PKCS7_SIGNED_new,
199PKCS7_SIGNER_INFO_free,
200PKCS7_SIGNER_INFO_new,
201PKCS7_SIGN_ENVELOPE_free,
202PKCS7_SIGN_ENVELOPE_new,
203PKCS7_dup,
204PKCS7_free,
d8652be0 205PKCS7_new_ex,
12ce9ea2
RS
206PKCS7_new,
207PKCS7_print_ctx,
208PKCS8_PRIV_KEY_INFO_free,
209PKCS8_PRIV_KEY_INFO_new,
210PKEY_USAGE_PERIOD_free,
211PKEY_USAGE_PERIOD_new,
212POLICYINFO_free,
213POLICYINFO_new,
214POLICYQUALINFO_free,
215POLICYQUALINFO_new,
216POLICY_CONSTRAINTS_free,
217POLICY_CONSTRAINTS_new,
218POLICY_MAPPING_free,
219POLICY_MAPPING_new,
fa743582
RS
220PROFESSION_INFOS_free,
221PROFESSION_INFOS_new,
227d4265
DMSP
222PROFESSION_INFO_free,
223PROFESSION_INFO_new,
12ce9ea2
RS
224PROXY_CERT_INFO_EXTENSION_free,
225PROXY_CERT_INFO_EXTENSION_new,
226PROXY_POLICY_free,
227PROXY_POLICY_new,
228RSAPrivateKey_dup,
229RSAPublicKey_dup,
230RSA_OAEP_PARAMS_free,
231RSA_OAEP_PARAMS_new,
232RSA_PSS_PARAMS_free,
233RSA_PSS_PARAMS_new,
2145ba5e 234RSA_PSS_PARAMS_dup,
00606b06
HK
235SCRYPT_PARAMS_free,
236SCRYPT_PARAMS_new,
12ce9ea2
RS
237SXNETID_free,
238SXNETID_new,
239SXNET_free,
240SXNET_new,
241TLS_FEATURE_free,
242TLS_FEATURE_new,
243TS_ACCURACY_dup,
244TS_ACCURACY_free,
245TS_ACCURACY_new,
246TS_MSG_IMPRINT_dup,
247TS_MSG_IMPRINT_free,
248TS_MSG_IMPRINT_new,
249TS_REQ_dup,
250TS_REQ_free,
251TS_REQ_new,
252TS_RESP_dup,
253TS_RESP_free,
254TS_RESP_new,
255TS_STATUS_INFO_dup,
256TS_STATUS_INFO_free,
257TS_STATUS_INFO_new,
258TS_TST_INFO_dup,
259TS_TST_INFO_free,
260TS_TST_INFO_new,
261USERNOTICE_free,
262USERNOTICE_new,
263X509_ALGOR_free,
d9321c09 264X509_ALGOR_it,
12ce9ea2
RS
265X509_ALGOR_new,
266X509_ATTRIBUTE_dup,
267X509_ATTRIBUTE_free,
268X509_ATTRIBUTE_new,
269X509_CERT_AUX_free,
270X509_CERT_AUX_new,
271X509_CINF_free,
272X509_CINF_new,
273X509_CRL_INFO_free,
274X509_CRL_INFO_new,
12ce9ea2
RS
275X509_CRL_dup,
276X509_CRL_free,
277X509_CRL_new,
278X509_EXTENSION_dup,
279X509_EXTENSION_free,
280X509_EXTENSION_new,
281X509_NAME_ENTRY_dup,
282X509_NAME_ENTRY_free,
283X509_NAME_ENTRY_new,
284X509_NAME_dup,
285X509_NAME_free,
286X509_NAME_new,
287X509_REQ_INFO_free,
288X509_REQ_INFO_new,
289X509_REQ_dup,
290X509_REQ_free,
291X509_REQ_new,
e72dbd8e 292X509_REQ_new_ex,
12ce9ea2
RS
293X509_REVOKED_dup,
294X509_REVOKED_free,
295X509_REVOKED_new,
296X509_SIG_free,
297X509_SIG_new,
298X509_VAL_free,
299X509_VAL_new,
300X509_dup,
301- ASN1 object utilities
302
303=head1 SYNOPSIS
304
bb82531f 305=for openssl generic
b97fdb57 306
12ce9ea2
RS
307 #include <openssl/asn1t.h>
308
91da5e77
RS
309 DECLARE_ASN1_FUNCTIONS(type)
310 IMPLEMENT_ASN1_FUNCTIONS(stname)
12ce9ea2
RS
311
312 typedef struct ASN1_ITEM_st ASN1_ITEM;
313
314 extern const ASN1_ITEM TYPE_it;
315 TYPE *TYPE_new(void);
9fdcc21f 316 TYPE *TYPE_dup(const TYPE *a);
12ce9ea2
RS
317 void TYPE_free(TYPE *a);
318 int TYPE_print_ctx(BIO *out, TYPE *a, int indent, const ASN1_PCTX *pctx);
319
12ce9ea2
RS
320=head1 DESCRIPTION
321
bbecf04e
RL
322In the description below, B<I<TYPE>> is used
323as a placeholder for any of the OpenSSL datatypes, such as B<X509>.
12ce9ea2
RS
324
325The OpenSSL ASN1 parsing library templates are like a data-driven bytecode
326interpreter.
327Every ASN1 object as a global variable, TYPE_it, that describes the item
328such as its fields. (On systems which cannot export variables from shared
329libraries, the global is instead a function which returns a pointer to a
330static variable.
331
332The macro DECLARE_ASN1_FUNCTIONS() is typically used in header files
333to generate the function declarations.
334
335The macro IMPLEMENT_ASN1_FUNCTIONS() is used once in a source file
336to generate the function bodies.
337
338
bbecf04e
RL
339B<I<TYPE>_new>() allocates an empty object of the indicated type.
340The object returned must be released by calling B<I<TYPE>_free>().
12ce9ea2 341
d8652be0 342B<I<TYPE>_new_ex>() is similiar to B<I<TYPE>_new>() but also passes the
90a1f2d7
SL
343library context I<libctx> and the property query I<propq> to use when retrieving
344algorithms from providers.
345
bbecf04e 346B<I<TYPE>_dup>() copies an existing object, leaving it untouched.
12ce9ea2 347
bbecf04e 348B<I<TYPE>_free>() releases the object and all pointers and sub-objects
12ce9ea2
RS
349within it.
350
bbecf04e
RL
351B<I<TYPE>_print_ctx>() prints the object I<a> on the specified BIO I<out>.
352Each line will be prefixed with I<indent> spaces.
353The I<pctx> specifies the printing context and is for internal
12ce9ea2 354use; use NULL to get the default behavior. If a print function is
bbecf04e 355user-defined, then pass in any I<pctx> down to any nested calls.
12ce9ea2
RS
356
357=head1 RETURN VALUES
358
90a1f2d7
SL
359B<I<TYPE>_new>(), B<I<TYPE>_new_ex>() and B<I<TYPE>_dup>() return a pointer to
360the object or NULL on failure.
12ce9ea2 361
bbecf04e 362B<I<TYPE>_print_ctx>() returns 1 on success or zero on failure.
12ce9ea2 363
90a1f2d7
SL
364=head1 HISTORY
365
746f3674 366The functions PKCS7_new_ex() and CMS_ContentInfo_new_ex() were
90a1f2d7
SL
367added in OpenSSL 3.0.
368
12ce9ea2
RS
369=head1 COPYRIGHT
370
33388b44 371Copyright 2016-2020 The OpenSSL Project Authors. All Rights Reserved.
12ce9ea2 372
4746f25a 373Licensed under the Apache License 2.0 (the "License"). You may not use
12ce9ea2
RS
374this file except in compliance with the License. You can obtain a copy
375in the file LICENSE in the source distribution or at
376L<https://www.openssl.org/source/license.html>.
377
378=cut