X509_dup.pod 8.8 KB

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