1X509_DUP(3) OpenSSL X509_DUP(3)
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_print_ctx,
16 CMS_ReceiptRequest_free, CMS_ReceiptRequest_new, CRL_DIST_POINTS_free,
17 CRL_DIST_POINTS_new, DIRECTORYSTRING_free, DIRECTORYSTRING_new,
18 DISPLAYTEXT_free, DISPLAYTEXT_new, DIST_POINT_NAME_free,
19 DIST_POINT_NAME_new, DIST_POINT_free, DIST_POINT_new, DSAparams_dup,
20 ECPARAMETERS_free, ECPARAMETERS_new, ECPKPARAMETERS_free,
21 ECPKPARAMETERS_new, EDIPARTYNAME_free, EDIPARTYNAME_new,
22 ESS_CERT_ID_dup, ESS_CERT_ID_free, ESS_CERT_ID_new,
23 ESS_ISSUER_SERIAL_dup, ESS_ISSUER_SERIAL_free, ESS_ISSUER_SERIAL_new,
24 ESS_SIGNING_CERT_dup, ESS_SIGNING_CERT_free, ESS_SIGNING_CERT_new,
25 EXTENDED_KEY_USAGE_free, EXTENDED_KEY_USAGE_new, GENERAL_NAMES_free,
26 GENERAL_NAMES_new, GENERAL_NAME_dup, GENERAL_NAME_free,
27 GENERAL_NAME_new, GENERAL_SUBTREE_free, GENERAL_SUBTREE_new,
28 IPAddressChoice_free, IPAddressChoice_new, IPAddressFamily_free,
29 IPAddressFamily_new, IPAddressOrRange_free, IPAddressOrRange_new,
30 IPAddressRange_free, IPAddressRange_new, ISSUING_DIST_POINT_free,
31 ISSUING_DIST_POINT_new, NAME_CONSTRAINTS_free, NAME_CONSTRAINTS_new,
32 NAMING_AUTHORITY_free, NAMING_AUTHORITY_new,
33 NETSCAPE_CERT_SEQUENCE_free, NETSCAPE_CERT_SEQUENCE_new,
34 NETSCAPE_SPKAC_free, NETSCAPE_SPKAC_new, NETSCAPE_SPKI_free,
35 NETSCAPE_SPKI_new, NOTICEREF_free, NOTICEREF_new, OCSP_BASICRESP_free,
36 OCSP_BASICRESP_new, OCSP_CERTID_dup, OCSP_CERTID_new,
37 OCSP_CERTSTATUS_free, OCSP_CERTSTATUS_new, OCSP_CRLID_free,
38 OCSP_CRLID_new, OCSP_ONEREQ_free, OCSP_ONEREQ_new, OCSP_REQINFO_free,
39 OCSP_REQINFO_new, OCSP_RESPBYTES_free, OCSP_RESPBYTES_new,
40 OCSP_RESPDATA_free, OCSP_RESPDATA_new, OCSP_RESPID_free,
41 OCSP_RESPID_new, OCSP_RESPONSE_new, OCSP_REVOKEDINFO_free,
42 OCSP_REVOKEDINFO_new, OCSP_SERVICELOC_free, OCSP_SERVICELOC_new,
43 OCSP_SIGNATURE_free, OCSP_SIGNATURE_new, OCSP_SINGLERESP_free,
44 OCSP_SINGLERESP_new, OTHERNAME_free, OTHERNAME_new, PBE2PARAM_free,
45 PBE2PARAM_new, PBEPARAM_free, PBEPARAM_new, PBKDF2PARAM_free,
46 PBKDF2PARAM_new, PKCS12_BAGS_free, PKCS12_BAGS_new,
47 PKCS12_MAC_DATA_free, PKCS12_MAC_DATA_new, PKCS12_SAFEBAG_free,
48 PKCS12_SAFEBAG_new, PKCS12_free, PKCS12_new, PKCS7_DIGEST_free,
49 PKCS7_DIGEST_new, PKCS7_ENCRYPT_free, PKCS7_ENCRYPT_new,
50 PKCS7_ENC_CONTENT_free, PKCS7_ENC_CONTENT_new, PKCS7_ENVELOPE_free,
51 PKCS7_ENVELOPE_new, PKCS7_ISSUER_AND_SERIAL_free,
52 PKCS7_ISSUER_AND_SERIAL_new, PKCS7_RECIP_INFO_free,
53 PKCS7_RECIP_INFO_new, PKCS7_SIGNED_free, PKCS7_SIGNED_new,
54 PKCS7_SIGNER_INFO_free, PKCS7_SIGNER_INFO_new,
55 PKCS7_SIGN_ENVELOPE_free, PKCS7_SIGN_ENVELOPE_new, PKCS7_dup,
56 PKCS7_free, PKCS7_new, PKCS7_print_ctx, PKCS8_PRIV_KEY_INFO_free,
57 PKCS8_PRIV_KEY_INFO_new, PKEY_USAGE_PERIOD_free, PKEY_USAGE_PERIOD_new,
58 POLICYINFO_free, POLICYINFO_new, POLICYQUALINFO_free,
59 POLICYQUALINFO_new, POLICY_CONSTRAINTS_free, POLICY_CONSTRAINTS_new,
60 POLICY_MAPPING_free, POLICY_MAPPING_new, PROFESSION_INFO_free,
61 PROFESSION_INFO_new, PROFESSION_INFOS_free, PROFESSION_INFOS_new,
62 PROXY_CERT_INFO_EXTENSION_free, PROXY_CERT_INFO_EXTENSION_new,
63 PROXY_POLICY_free, PROXY_POLICY_new, RSAPrivateKey_dup,
64 RSAPublicKey_dup, RSA_OAEP_PARAMS_free, RSA_OAEP_PARAMS_new,
65 RSA_PSS_PARAMS_free, RSA_PSS_PARAMS_new, SCRYPT_PARAMS_free,
66 SCRYPT_PARAMS_new, SXNETID_free, SXNETID_new, SXNET_free, SXNET_new,
67 TLS_FEATURE_free, TLS_FEATURE_new, TS_ACCURACY_dup, TS_ACCURACY_free,
68 TS_ACCURACY_new, TS_MSG_IMPRINT_dup, TS_MSG_IMPRINT_free,
69 TS_MSG_IMPRINT_new, TS_REQ_dup, TS_REQ_free, TS_REQ_new, TS_RESP_dup,
70 TS_RESP_free, TS_RESP_new, TS_STATUS_INFO_dup, TS_STATUS_INFO_free,
71 TS_STATUS_INFO_new, TS_TST_INFO_dup, TS_TST_INFO_free, TS_TST_INFO_new,
72 USERNOTICE_free, USERNOTICE_new, X509_ALGOR_free, X509_ALGOR_new,
73 X509_ATTRIBUTE_dup, X509_ATTRIBUTE_free, X509_ATTRIBUTE_new,
74 X509_CERT_AUX_free, X509_CERT_AUX_new, X509_CINF_free, X509_CINF_new,
75 X509_CRL_INFO_free, X509_CRL_INFO_new, X509_CRL_dup, X509_CRL_free,
76 X509_CRL_new, X509_EXTENSION_dup, X509_EXTENSION_free,
77 X509_EXTENSION_new, X509_NAME_ENTRY_dup, X509_NAME_ENTRY_free,
78 X509_NAME_ENTRY_new, X509_NAME_dup, X509_NAME_free, X509_NAME_new,
79 X509_REQ_INFO_free, X509_REQ_INFO_new, X509_REQ_dup, X509_REQ_free,
80 X509_REQ_new, X509_REVOKED_dup, X509_REVOKED_free, X509_REVOKED_new,
81 X509_SIG_free, X509_SIG_new, X509_VAL_free, X509_VAL_new, X509_dup, -
82 ASN1 object utilities
83
85 #include <openssl/asn1t.h>
86
87 DECLARE_ASN1_FUNCTIONS(type)
88 IMPLEMENT_ASN1_FUNCTIONS(stname)
89
90 typedef struct ASN1_ITEM_st ASN1_ITEM;
91
92 extern const ASN1_ITEM TYPE_it;
93 TYPE *TYPE_new(void);
94 TYPE *TYPE_dup(TYPE *a);
95 void TYPE_free(TYPE *a);
96 int TYPE_print_ctx(BIO *out, TYPE *a, int indent, const ASN1_PCTX *pctx);
97
99 In the description below, TYPE is used as a placeholder for any of the
100 OpenSSL datatypes, such as X509.
101
102 The OpenSSL ASN1 parsing library templates are like a data-driven
103 bytecode interpreter. Every ASN1 object as a global variable, TYPE_it,
104 that describes the item such as its fields. (On systems which cannot
105 export variables from shared libraries, the global is instead a
106 function which returns a pointer to a static variable.
107
108 The macro DECLARE_ASN1_FUNCTIONS() is typically used in header files to
109 generate the function declarations.
110
111 The macro IMPLEMENT_ASN1_FUNCTIONS() is used once in a source file to
112 generate the function bodies.
113
114 TYPE_new() allocates an empty object of the indicated type. The object
115 returned must be released by calling TYPE_free().
116
117 TYPE_dup() copies an existing object.
118
119 TYPE_free() releases the object and all pointers and sub-objects within
120 it.
121
122 TYPE_print_ctx() prints the object a on the specified BIO out. Each
123 line will be prefixed with indent spaces. The pctx specifies the
124 printing context and is for internal use; use NULL to get the default
125 behavior. If a print function is user-defined, then pass in any pctx
126 down to any nested calls.
127
129 TYPE_new() and TYPE_dup() return a pointer to the object or NULL on
130 failure.
131
132 TYPE_print_ctx() returns 1 on success or zero on failure.
133
135 Copyright 2016-2018 The OpenSSL Project Authors. All Rights Reserved.
136
137 Licensed under the OpenSSL license (the "License"). You may not use
138 this file except in compliance with the License. You can obtain a copy
139 in the file LICENSE in the source distribution or at
140 <https://www.openssl.org/source/license.html>.
141
142
143
1441.1.1i 2021-07-22 X509_DUP(3)