1X509_DUP(3ossl) OpenSSL X509_DUP(3ossl)
2
3
4
6 DECLARE_ASN1_FUNCTIONS, IMPLEMENT_ASN1_FUNCTIONS, ASN1_ITEM,
7 ACCESS_DESCRIPTION_free, ACCESS_DESCRIPTION_new, ADMISSIONS_free,
8 ADMISSIONS_new, ADMISSION_SYNTAX_free, ADMISSION_SYNTAX_new,
9 ASIdOrRange_free, ASIdOrRange_new, ASIdentifierChoice_free,
10 ASIdentifierChoice_new, ASIdentifiers_free, ASIdentifiers_new,
11 ASRange_free, ASRange_new, AUTHORITY_INFO_ACCESS_free,
12 AUTHORITY_INFO_ACCESS_new, AUTHORITY_KEYID_free, AUTHORITY_KEYID_new,
13 BASIC_CONSTRAINTS_free, BASIC_CONSTRAINTS_new,
14 CERTIFICATEPOLICIES_free, CERTIFICATEPOLICIES_new,
15 CMS_ContentInfo_free, CMS_ContentInfo_new, CMS_ContentInfo_new_ex,
16 CMS_ContentInfo_print_ctx, CMS_ReceiptRequest_free,
17 CMS_ReceiptRequest_new, CRL_DIST_POINTS_free, CRL_DIST_POINTS_new,
18 DIRECTORYSTRING_free, DIRECTORYSTRING_new, DISPLAYTEXT_free,
19 DISPLAYTEXT_new, DIST_POINT_NAME_free, DIST_POINT_NAME_new,
20 DIST_POINT_free, DIST_POINT_new, DSAparams_dup, ECPARAMETERS_free,
21 ECPARAMETERS_new, ECPKPARAMETERS_free, ECPKPARAMETERS_new,
22 EDIPARTYNAME_free, EDIPARTYNAME_new, ESS_CERT_ID_dup, ESS_CERT_ID_free,
23 ESS_CERT_ID_new, ESS_CERT_ID_V2_dup, ESS_CERT_ID_V2_free,
24 ESS_CERT_ID_V2_new, ESS_ISSUER_SERIAL_dup, ESS_ISSUER_SERIAL_free,
25 ESS_ISSUER_SERIAL_new, ESS_SIGNING_CERT_dup, ESS_SIGNING_CERT_free,
26 ESS_SIGNING_CERT_it, ESS_SIGNING_CERT_new, ESS_SIGNING_CERT_V2_dup,
27 ESS_SIGNING_CERT_V2_free, ESS_SIGNING_CERT_V2_it,
28 ESS_SIGNING_CERT_V2_new, EXTENDED_KEY_USAGE_free,
29 EXTENDED_KEY_USAGE_new, GENERAL_NAMES_free, GENERAL_NAMES_new,
30 GENERAL_NAME_dup, GENERAL_NAME_free, GENERAL_NAME_new,
31 GENERAL_SUBTREE_free, GENERAL_SUBTREE_new, IPAddressChoice_free,
32 IPAddressChoice_new, IPAddressFamily_free, IPAddressFamily_new,
33 IPAddressOrRange_free, IPAddressOrRange_new, IPAddressRange_free,
34 IPAddressRange_new, ISSUER_SIGN_TOOL_free, ISSUER_SIGN_TOOL_it,
35 ISSUER_SIGN_TOOL_new, ISSUING_DIST_POINT_free, ISSUING_DIST_POINT_it,
36 ISSUING_DIST_POINT_new, NAME_CONSTRAINTS_free, NAME_CONSTRAINTS_new,
37 NAMING_AUTHORITY_free, NAMING_AUTHORITY_new,
38 NETSCAPE_CERT_SEQUENCE_free, NETSCAPE_CERT_SEQUENCE_new,
39 NETSCAPE_SPKAC_free, NETSCAPE_SPKAC_new, NETSCAPE_SPKI_free,
40 NETSCAPE_SPKI_new, NOTICEREF_free, NOTICEREF_new, OCSP_BASICRESP_free,
41 OCSP_BASICRESP_new, OCSP_CERTID_dup, OCSP_CERTID_new,
42 OCSP_CERTSTATUS_free, OCSP_CERTSTATUS_new, OCSP_CRLID_free,
43 OCSP_CRLID_new, OCSP_ONEREQ_free, OCSP_ONEREQ_new, OCSP_REQINFO_free,
44 OCSP_REQINFO_new, OCSP_RESPBYTES_free, OCSP_RESPBYTES_new,
45 OCSP_RESPDATA_free, OCSP_RESPDATA_new, OCSP_RESPID_free,
46 OCSP_RESPID_new, OCSP_RESPONSE_new, OCSP_REVOKEDINFO_free,
47 OCSP_REVOKEDINFO_new, OCSP_SERVICELOC_free, OCSP_SERVICELOC_new,
48 OCSP_SIGNATURE_free, OCSP_SIGNATURE_new, OCSP_SINGLERESP_free,
49 OCSP_SINGLERESP_new, OSSL_CMP_ITAV_dup, OSSL_CMP_ITAV_free,
50 OSSL_CMP_MSG_dup, OSSL_CMP_MSG_it, OSSL_CMP_MSG_free,
51 OSSL_CMP_PKIHEADER_free, OSSL_CMP_PKIHEADER_it, OSSL_CMP_PKIHEADER_new,
52 OSSL_CMP_PKISI_dup, OSSL_CMP_PKISI_free, OSSL_CMP_PKISI_it,
53 OSSL_CMP_PKISI_new, OSSL_CMP_PKISTATUS_it, OSSL_CRMF_CERTID_dup,
54 OSSL_CRMF_CERTID_free, OSSL_CRMF_CERTID_it, OSSL_CRMF_CERTID_new,
55 OSSL_CRMF_CERTTEMPLATE_free, OSSL_CRMF_CERTTEMPLATE_it,
56 OSSL_CRMF_CERTTEMPLATE_new, OSSL_CRMF_ENCRYPTEDVALUE_free,
57 OSSL_CRMF_ENCRYPTEDVALUE_it, OSSL_CRMF_ENCRYPTEDVALUE_new,
58 OSSL_CRMF_MSGS_free, OSSL_CRMF_MSGS_it, OSSL_CRMF_MSGS_new,
59 OSSL_CRMF_MSG_dup, OSSL_CRMF_MSG_free, OSSL_CRMF_MSG_it,
60 OSSL_CRMF_MSG_new, OSSL_CRMF_PBMPARAMETER_free,
61 OSSL_CRMF_PBMPARAMETER_it, OSSL_CRMF_PBMPARAMETER_new,
62 OSSL_CRMF_PKIPUBLICATIONINFO_free, OSSL_CRMF_PKIPUBLICATIONINFO_it,
63 OSSL_CRMF_PKIPUBLICATIONINFO_new, OSSL_CRMF_SINGLEPUBINFO_free,
64 OSSL_CRMF_SINGLEPUBINFO_it, OSSL_CRMF_SINGLEPUBINFO_new,
65 OTHERNAME_free, OTHERNAME_new, PBE2PARAM_free, PBE2PARAM_new,
66 PBEPARAM_free, PBEPARAM_new, PBKDF2PARAM_free, PBKDF2PARAM_new,
67 PKCS12_BAGS_free, PKCS12_BAGS_new, PKCS12_MAC_DATA_free,
68 PKCS12_MAC_DATA_new, PKCS12_SAFEBAG_free, PKCS12_SAFEBAG_new,
69 PKCS12_free, PKCS12_new, PKCS7_DIGEST_free, PKCS7_DIGEST_new,
70 PKCS7_ENCRYPT_free, PKCS7_ENCRYPT_new, PKCS7_ENC_CONTENT_free,
71 PKCS7_ENC_CONTENT_new, PKCS7_ENVELOPE_free, PKCS7_ENVELOPE_new,
72 PKCS7_ISSUER_AND_SERIAL_free, PKCS7_ISSUER_AND_SERIAL_new,
73 PKCS7_RECIP_INFO_free, PKCS7_RECIP_INFO_new, PKCS7_SIGNED_free,
74 PKCS7_SIGNED_new, PKCS7_SIGNER_INFO_free, PKCS7_SIGNER_INFO_new,
75 PKCS7_SIGN_ENVELOPE_free, PKCS7_SIGN_ENVELOPE_new, PKCS7_dup,
76 PKCS7_free, PKCS7_new_ex, PKCS7_new, PKCS7_print_ctx,
77 PKCS8_PRIV_KEY_INFO_free, PKCS8_PRIV_KEY_INFO_new,
78 PKEY_USAGE_PERIOD_free, PKEY_USAGE_PERIOD_new, POLICYINFO_free,
79 POLICYINFO_new, POLICYQUALINFO_free, POLICYQUALINFO_new,
80 POLICY_CONSTRAINTS_free, POLICY_CONSTRAINTS_new, POLICY_MAPPING_free,
81 POLICY_MAPPING_new, PROFESSION_INFOS_free, PROFESSION_INFOS_new,
82 PROFESSION_INFO_free, PROFESSION_INFO_new,
83 PROXY_CERT_INFO_EXTENSION_free, PROXY_CERT_INFO_EXTENSION_new,
84 PROXY_POLICY_free, PROXY_POLICY_new, RSAPrivateKey_dup,
85 RSAPublicKey_dup, RSA_OAEP_PARAMS_free, RSA_OAEP_PARAMS_new,
86 RSA_PSS_PARAMS_free, RSA_PSS_PARAMS_new, RSA_PSS_PARAMS_dup,
87 SCRYPT_PARAMS_free, SCRYPT_PARAMS_new, SXNETID_free, SXNETID_new,
88 SXNET_free, SXNET_new, TLS_FEATURE_free, TLS_FEATURE_new,
89 TS_ACCURACY_dup, TS_ACCURACY_free, TS_ACCURACY_new, TS_MSG_IMPRINT_dup,
90 TS_MSG_IMPRINT_free, TS_MSG_IMPRINT_new, TS_REQ_dup, TS_REQ_free,
91 TS_REQ_new, TS_RESP_dup, TS_RESP_free, TS_RESP_new, TS_STATUS_INFO_dup,
92 TS_STATUS_INFO_free, TS_STATUS_INFO_new, TS_TST_INFO_dup,
93 TS_TST_INFO_free, TS_TST_INFO_new, USERNOTICE_free, USERNOTICE_new,
94 X509_ALGOR_free, X509_ALGOR_it, X509_ALGOR_new, X509_ATTRIBUTE_dup,
95 X509_ATTRIBUTE_free, X509_ATTRIBUTE_new, X509_CERT_AUX_free,
96 X509_CERT_AUX_new, X509_CINF_free, X509_CINF_new, X509_CRL_INFO_free,
97 X509_CRL_INFO_new, X509_CRL_dup, X509_CRL_free, X509_CRL_new_ex,
98 X509_CRL_new, X509_EXTENSION_dup, X509_EXTENSION_free,
99 X509_EXTENSION_new, X509_NAME_ENTRY_dup, X509_NAME_ENTRY_free,
100 X509_NAME_ENTRY_new, X509_NAME_dup, X509_NAME_free, X509_NAME_new,
101 X509_REQ_INFO_free, X509_REQ_INFO_new, X509_REQ_dup, X509_REQ_free,
102 X509_REQ_new, X509_REQ_new_ex, X509_REVOKED_dup, X509_REVOKED_free,
103 X509_REVOKED_new, X509_SIG_free, X509_SIG_new, X509_VAL_free,
104 X509_VAL_new, X509_dup, - ASN1 object utilities
105
107 #include <openssl/asn1t.h>
108
109 DECLARE_ASN1_FUNCTIONS(type)
110 IMPLEMENT_ASN1_FUNCTIONS(stname)
111
112 typedef struct ASN1_ITEM_st ASN1_ITEM;
113
114 extern const ASN1_ITEM TYPE_it;
115 TYPE *TYPE_new(void);
116 TYPE *TYPE_dup(const TYPE *a);
117 void TYPE_free(TYPE *a);
118 int TYPE_print_ctx(BIO *out, TYPE *a, int indent, const ASN1_PCTX *pctx);
119
120 The following functions have been deprecated since OpenSSL 3.0, and can
121 be hidden entirely by defining OPENSSL_API_COMPAT with a suitable
122 version value, see openssl_user_macros(7):
123
124 DSA *DSAparams_dup(const DSA *dsa);
125 RSA *RSAPrivateKey_dup(const RSA *rsa);
126 RSA *RSAPublicKey_dup(const RSA *rsa);
127
129 In the description below, TYPE is used as a placeholder for any of the
130 OpenSSL datatypes, such as X509.
131
132 The OpenSSL ASN1 parsing library templates are like a data-driven
133 bytecode interpreter. Every ASN1 object as a global variable, TYPE_it,
134 that describes the item such as its fields. (On systems which cannot
135 export variables from shared libraries, the global is instead a
136 function which returns a pointer to a static variable.
137
138 The macro DECLARE_ASN1_FUNCTIONS() is typically used in header files to
139 generate the function declarations.
140
141 The macro IMPLEMENT_ASN1_FUNCTIONS() is used once in a source file to
142 generate the function bodies.
143
144 TYPE_new() allocates an empty object of the indicated type. The object
145 returned must be released by calling TYPE_free().
146
147 TYPE_new_ex() is similar to TYPE_new() but also passes the library
148 context libctx and the property query propq to use when retrieving
149 algorithms from providers. This created object can then be used when
150 loading binary data using d2i_TYPE().
151
152 TYPE_dup() copies an existing object, leaving it untouched.
153
154 TYPE_free() releases the object and all pointers and sub-objects within
155 it.
156
157 TYPE_print_ctx() prints the object a on the specified BIO out. Each
158 line will be prefixed with indent spaces. The pctx specifies the
159 printing context and is for internal use; use NULL to get the default
160 behavior. If a print function is user-defined, then pass in any pctx
161 down to any nested calls.
162
164 TYPE_new(), TYPE_new_ex() and TYPE_dup() return a pointer to the object
165 or NULL on failure.
166
167 TYPE_print_ctx() returns 1 on success or zero on failure.
168
170 The functions X509_REQ_new_ex(), X509_CRL_new_ex(), PKCS7_new_ex() and
171 CMS_ContentInfo_new_ex() were added in OpenSSL 3.0.
172
173 The functions DSAparams_dup(), RSAPrivateKey_dup() and
174 RSAPublicKey_dup() were deprecated in 3.0.
175
177 Copyright 2016-2022 The OpenSSL Project Authors. All Rights Reserved.
178
179 Licensed under the Apache License 2.0 (the "License"). You may not use
180 this file except in compliance with the License. You can obtain a copy
181 in the file LICENSE in the source distribution or at
182 <https://www.openssl.org/source/license.html>.
183
184
185
1863.1.1 2023-08-31 X509_DUP(3ossl)