X509_dup.3ossl 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539
  1. .\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.42)
  2. .\"
  3. .\" Standard preamble:
  4. .\" ========================================================================
  5. .de Sp \" Vertical space (when we can't use .PP)
  6. .if t .sp .5v
  7. .if n .sp
  8. ..
  9. .de Vb \" Begin verbatim text
  10. .ft CW
  11. .nf
  12. .ne \\$1
  13. ..
  14. .de Ve \" End verbatim text
  15. .ft R
  16. .fi
  17. ..
  18. .\" Set up some character translations and predefined strings. \*(-- will
  19. .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left
  20. .\" double quote, and \*(R" will give a right double quote. \*(C+ will
  21. .\" give a nicer C++. Capital omega is used to do unbreakable dashes and
  22. .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff,
  23. .\" nothing in troff, for use with C<>.
  24. .tr \(*W-
  25. .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p'
  26. .ie n \{\
  27. . ds -- \(*W-
  28. . ds PI pi
  29. . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch
  30. . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch
  31. . ds L" ""
  32. . ds R" ""
  33. . ds C` ""
  34. . ds C' ""
  35. 'br\}
  36. .el\{\
  37. . ds -- \|\(em\|
  38. . ds PI \(*p
  39. . ds L" ``
  40. . ds R" ''
  41. . ds C`
  42. . ds C'
  43. 'br\}
  44. .\"
  45. .\" Escape single quotes in literal strings from groff's Unicode transform.
  46. .ie \n(.g .ds Aq \(aq
  47. .el .ds Aq '
  48. .\"
  49. .\" If the F register is >0, we'll generate index entries on stderr for
  50. .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index
  51. .\" entries marked with X<> in POD. Of course, you'll have to process the
  52. .\" output yourself in some meaningful fashion.
  53. .\"
  54. .\" Avoid warning from groff about undefined register 'F'.
  55. .de IX
  56. ..
  57. .nr rF 0
  58. .if \n(.g .if rF .nr rF 1
  59. .if (\n(rF:(\n(.g==0)) \{\
  60. . if \nF \{\
  61. . de IX
  62. . tm Index:\\$1\t\\n%\t"\\$2"
  63. ..
  64. . if !\nF==2 \{\
  65. . nr % 0
  66. . nr F 2
  67. . \}
  68. . \}
  69. .\}
  70. .rr rF
  71. .\"
  72. .\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2).
  73. .\" Fear. Run. Save yourself. No user-serviceable parts.
  74. . \" fudge factors for nroff and troff
  75. .if n \{\
  76. . ds #H 0
  77. . ds #V .8m
  78. . ds #F .3m
  79. . ds #[ \f1
  80. . ds #] \fP
  81. .\}
  82. .if t \{\
  83. . ds #H ((1u-(\\\\n(.fu%2u))*.13m)
  84. . ds #V .6m
  85. . ds #F 0
  86. . ds #[ \&
  87. . ds #] \&
  88. .\}
  89. . \" simple accents for nroff and troff
  90. .if n \{\
  91. . ds ' \&
  92. . ds ` \&
  93. . ds ^ \&
  94. . ds , \&
  95. . ds ~ ~
  96. . ds /
  97. .\}
  98. .if t \{\
  99. . ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u"
  100. . ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u'
  101. . ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u'
  102. . ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u'
  103. . ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u'
  104. . ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u'
  105. .\}
  106. . \" troff and (daisy-wheel) nroff accents
  107. .ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V'
  108. .ds 8 \h'\*(#H'\(*b\h'-\*(#H'
  109. .ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#]
  110. .ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H'
  111. .ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u'
  112. .ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#]
  113. .ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#]
  114. .ds ae a\h'-(\w'a'u*4/10)'e
  115. .ds Ae A\h'-(\w'A'u*4/10)'E
  116. . \" corrections for vroff
  117. .if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u'
  118. .if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u'
  119. . \" for low resolution devices (crt and lpr)
  120. .if \n(.H>23 .if \n(.V>19 \
  121. \{\
  122. . ds : e
  123. . ds 8 ss
  124. . ds o a
  125. . ds d- d\h'-1'\(ga
  126. . ds D- D\h'-1'\(hy
  127. . ds th \o'bp'
  128. . ds Th \o'LP'
  129. . ds ae ae
  130. . ds Ae AE
  131. .\}
  132. .rm #[ #] #H #V #F C
  133. .\" ========================================================================
  134. .\"
  135. .IX Title "X509_DUP 3ossl"
  136. .TH X509_DUP 3ossl "2024-09-03" "3.3.2" "OpenSSL"
  137. .\" For nroff, turn off justification. Always turn off hyphenation; it makes
  138. .\" way too many mistakes in technical documents.
  139. .if n .ad l
  140. .nh
  141. .SH "NAME"
  142. DECLARE_ASN1_FUNCTIONS,
  143. IMPLEMENT_ASN1_FUNCTIONS,
  144. ASN1_ITEM,
  145. ACCESS_DESCRIPTION_free,
  146. ACCESS_DESCRIPTION_new,
  147. ADMISSIONS_free,
  148. ADMISSIONS_new,
  149. ADMISSION_SYNTAX_free,
  150. ADMISSION_SYNTAX_new,
  151. ASIdOrRange_free,
  152. ASIdOrRange_new,
  153. ASIdentifierChoice_free,
  154. ASIdentifierChoice_new,
  155. ASIdentifiers_free,
  156. ASIdentifiers_new,
  157. ASRange_free,
  158. ASRange_new,
  159. AUTHORITY_INFO_ACCESS_free,
  160. AUTHORITY_INFO_ACCESS_new,
  161. AUTHORITY_KEYID_free,
  162. AUTHORITY_KEYID_new,
  163. BASIC_CONSTRAINTS_free,
  164. BASIC_CONSTRAINTS_new,
  165. CERTIFICATEPOLICIES_free,
  166. CERTIFICATEPOLICIES_new,
  167. CMS_ContentInfo_free,
  168. CMS_ContentInfo_new,
  169. CMS_ContentInfo_new_ex,
  170. CMS_ContentInfo_print_ctx,
  171. CMS_EnvelopedData_it,
  172. CMS_ReceiptRequest_free,
  173. CMS_ReceiptRequest_new,
  174. CMS_SignedData_free,
  175. CMS_SignedData_new,
  176. CRL_DIST_POINTS_free,
  177. CRL_DIST_POINTS_new,
  178. DIRECTORYSTRING_free,
  179. DIRECTORYSTRING_new,
  180. DISPLAYTEXT_free,
  181. DISPLAYTEXT_new,
  182. DIST_POINT_NAME_free,
  183. DIST_POINT_NAME_new,
  184. DIST_POINT_free,
  185. DIST_POINT_new,
  186. DSAparams_dup,
  187. ECPARAMETERS_free,
  188. ECPARAMETERS_new,
  189. ECPKPARAMETERS_free,
  190. ECPKPARAMETERS_new,
  191. EDIPARTYNAME_free,
  192. EDIPARTYNAME_new,
  193. ESS_CERT_ID_dup,
  194. ESS_CERT_ID_free,
  195. ESS_CERT_ID_new,
  196. ESS_CERT_ID_V2_dup,
  197. ESS_CERT_ID_V2_free,
  198. ESS_CERT_ID_V2_new,
  199. ESS_ISSUER_SERIAL_dup,
  200. ESS_ISSUER_SERIAL_free,
  201. ESS_ISSUER_SERIAL_new,
  202. ESS_SIGNING_CERT_dup,
  203. ESS_SIGNING_CERT_free,
  204. ESS_SIGNING_CERT_it,
  205. ESS_SIGNING_CERT_new,
  206. ESS_SIGNING_CERT_V2_dup,
  207. ESS_SIGNING_CERT_V2_free,
  208. ESS_SIGNING_CERT_V2_it,
  209. ESS_SIGNING_CERT_V2_new,
  210. EXTENDED_KEY_USAGE_free,
  211. EXTENDED_KEY_USAGE_new,
  212. GENERAL_NAMES_free,
  213. GENERAL_NAMES_new,
  214. GENERAL_NAME_dup,
  215. GENERAL_NAME_free,
  216. GENERAL_NAME_new,
  217. GENERAL_SUBTREE_free,
  218. GENERAL_SUBTREE_new,
  219. IPAddressChoice_free,
  220. IPAddressChoice_new,
  221. IPAddressFamily_free,
  222. IPAddressFamily_new,
  223. IPAddressOrRange_free,
  224. IPAddressOrRange_new,
  225. IPAddressRange_free,
  226. IPAddressRange_new,
  227. ISSUER_SIGN_TOOL_free,
  228. ISSUER_SIGN_TOOL_it,
  229. ISSUER_SIGN_TOOL_new,
  230. ISSUING_DIST_POINT_free,
  231. ISSUING_DIST_POINT_it,
  232. ISSUING_DIST_POINT_new,
  233. NAME_CONSTRAINTS_free,
  234. NAME_CONSTRAINTS_new,
  235. NAMING_AUTHORITY_free,
  236. NAMING_AUTHORITY_new,
  237. NETSCAPE_CERT_SEQUENCE_free,
  238. NETSCAPE_CERT_SEQUENCE_new,
  239. NETSCAPE_SPKAC_free,
  240. NETSCAPE_SPKAC_new,
  241. NETSCAPE_SPKI_free,
  242. NETSCAPE_SPKI_new,
  243. NOTICEREF_free,
  244. NOTICEREF_new,
  245. OCSP_BASICRESP_free,
  246. OCSP_BASICRESP_new,
  247. OCSP_CERTID_dup,
  248. OCSP_CERTID_new,
  249. OCSP_CERTSTATUS_free,
  250. OCSP_CERTSTATUS_new,
  251. OCSP_CRLID_free,
  252. OCSP_CRLID_new,
  253. OCSP_ONEREQ_free,
  254. OCSP_ONEREQ_new,
  255. OCSP_REQINFO_free,
  256. OCSP_REQINFO_new,
  257. OCSP_RESPBYTES_free,
  258. OCSP_RESPBYTES_new,
  259. OCSP_RESPDATA_free,
  260. OCSP_RESPDATA_new,
  261. OCSP_RESPID_free,
  262. OCSP_RESPID_new,
  263. OCSP_RESPONSE_new,
  264. OCSP_REVOKEDINFO_free,
  265. OCSP_REVOKEDINFO_new,
  266. OCSP_SERVICELOC_free,
  267. OCSP_SERVICELOC_new,
  268. OCSP_SIGNATURE_free,
  269. OCSP_SIGNATURE_new,
  270. OCSP_SINGLERESP_free,
  271. OCSP_SINGLERESP_new,
  272. OSSL_CMP_ITAV_dup,
  273. OSSL_CMP_ITAV_free,
  274. OSSL_CMP_MSG_dup,
  275. OSSL_CMP_MSG_it,
  276. OSSL_CMP_MSG_free,
  277. OSSL_CMP_PKIHEADER_free,
  278. OSSL_CMP_PKIHEADER_it,
  279. OSSL_CMP_PKIHEADER_new,
  280. OSSL_CMP_PKISI_dup,
  281. OSSL_CMP_PKISI_free,
  282. OSSL_CMP_PKISI_it,
  283. OSSL_CMP_PKISI_new,
  284. OSSL_CMP_PKISTATUS_it,
  285. OSSL_CRMF_CERTID_dup,
  286. OSSL_CRMF_CERTID_free,
  287. OSSL_CRMF_CERTID_it,
  288. OSSL_CRMF_CERTID_new,
  289. OSSL_CRMF_CERTTEMPLATE_free,
  290. OSSL_CRMF_CERTTEMPLATE_it,
  291. OSSL_CRMF_CERTTEMPLATE_new,
  292. OSSL_CRMF_ENCRYPTEDVALUE_free,
  293. OSSL_CRMF_ENCRYPTEDVALUE_it,
  294. OSSL_CRMF_ENCRYPTEDVALUE_new,
  295. OSSL_CRMF_MSGS_free,
  296. OSSL_CRMF_MSGS_it,
  297. OSSL_CRMF_MSGS_new,
  298. OSSL_CRMF_MSG_dup,
  299. OSSL_CRMF_MSG_free,
  300. OSSL_CRMF_MSG_it,
  301. OSSL_CRMF_MSG_new,
  302. OSSL_CRMF_PBMPARAMETER_free,
  303. OSSL_CRMF_PBMPARAMETER_it,
  304. OSSL_CRMF_PBMPARAMETER_new,
  305. OSSL_CRMF_PKIPUBLICATIONINFO_free,
  306. OSSL_CRMF_PKIPUBLICATIONINFO_it,
  307. OSSL_CRMF_PKIPUBLICATIONINFO_new,
  308. OSSL_CRMF_SINGLEPUBINFO_free,
  309. OSSL_CRMF_SINGLEPUBINFO_it,
  310. OSSL_CRMF_SINGLEPUBINFO_new,
  311. OTHERNAME_free,
  312. OTHERNAME_new,
  313. PBE2PARAM_free,
  314. PBE2PARAM_new,
  315. PBEPARAM_free,
  316. PBEPARAM_new,
  317. PBKDF2PARAM_free,
  318. PBKDF2PARAM_new,
  319. PKCS12_BAGS_free,
  320. PKCS12_BAGS_new,
  321. PKCS12_MAC_DATA_free,
  322. PKCS12_MAC_DATA_new,
  323. PKCS12_SAFEBAG_free,
  324. PKCS12_SAFEBAG_new,
  325. PKCS12_free,
  326. PKCS12_new,
  327. PKCS7_DIGEST_free,
  328. PKCS7_DIGEST_new,
  329. PKCS7_ENCRYPT_free,
  330. PKCS7_ENCRYPT_new,
  331. PKCS7_ENC_CONTENT_free,
  332. PKCS7_ENC_CONTENT_new,
  333. PKCS7_ENVELOPE_free,
  334. PKCS7_ENVELOPE_new,
  335. PKCS7_ISSUER_AND_SERIAL_free,
  336. PKCS7_ISSUER_AND_SERIAL_new,
  337. PKCS7_RECIP_INFO_free,
  338. PKCS7_RECIP_INFO_new,
  339. PKCS7_SIGNED_free,
  340. PKCS7_SIGNED_new,
  341. PKCS7_SIGNER_INFO_free,
  342. PKCS7_SIGNER_INFO_new,
  343. PKCS7_SIGN_ENVELOPE_free,
  344. PKCS7_SIGN_ENVELOPE_new,
  345. PKCS7_dup,
  346. PKCS7_free,
  347. PKCS7_new_ex,
  348. PKCS7_new,
  349. PKCS7_print_ctx,
  350. PKCS8_PRIV_KEY_INFO_free,
  351. PKCS8_PRIV_KEY_INFO_new,
  352. PKEY_USAGE_PERIOD_free,
  353. PKEY_USAGE_PERIOD_new,
  354. POLICYINFO_free,
  355. POLICYINFO_new,
  356. POLICYQUALINFO_free,
  357. POLICYQUALINFO_new,
  358. POLICY_CONSTRAINTS_free,
  359. POLICY_CONSTRAINTS_new,
  360. POLICY_MAPPING_free,
  361. POLICY_MAPPING_new,
  362. PROFESSION_INFOS_free,
  363. PROFESSION_INFOS_new,
  364. PROFESSION_INFO_free,
  365. PROFESSION_INFO_new,
  366. PROXY_CERT_INFO_EXTENSION_free,
  367. PROXY_CERT_INFO_EXTENSION_new,
  368. PROXY_POLICY_free,
  369. PROXY_POLICY_new,
  370. RSAPrivateKey_dup,
  371. RSAPublicKey_dup,
  372. RSA_OAEP_PARAMS_free,
  373. RSA_OAEP_PARAMS_new,
  374. RSA_PSS_PARAMS_free,
  375. RSA_PSS_PARAMS_new,
  376. RSA_PSS_PARAMS_dup,
  377. SCRYPT_PARAMS_free,
  378. SCRYPT_PARAMS_new,
  379. SXNETID_free,
  380. SXNETID_new,
  381. SXNET_free,
  382. SXNET_new,
  383. TLS_FEATURE_free,
  384. TLS_FEATURE_new,
  385. TS_ACCURACY_dup,
  386. TS_ACCURACY_free,
  387. TS_ACCURACY_new,
  388. TS_MSG_IMPRINT_dup,
  389. TS_MSG_IMPRINT_free,
  390. TS_MSG_IMPRINT_new,
  391. TS_REQ_dup,
  392. TS_REQ_free,
  393. TS_REQ_new,
  394. TS_RESP_dup,
  395. TS_RESP_free,
  396. TS_RESP_new,
  397. TS_STATUS_INFO_dup,
  398. TS_STATUS_INFO_free,
  399. TS_STATUS_INFO_new,
  400. TS_TST_INFO_dup,
  401. TS_TST_INFO_free,
  402. TS_TST_INFO_new,
  403. USERNOTICE_free,
  404. USERNOTICE_new,
  405. X509_ALGOR_free,
  406. X509_ALGOR_it,
  407. X509_ALGOR_new,
  408. X509_ATTRIBUTE_dup,
  409. X509_ATTRIBUTE_free,
  410. X509_ATTRIBUTE_new,
  411. X509_CERT_AUX_free,
  412. X509_CERT_AUX_new,
  413. X509_CINF_free,
  414. X509_CINF_new,
  415. X509_CRL_INFO_free,
  416. X509_CRL_INFO_new,
  417. X509_CRL_dup,
  418. X509_CRL_free,
  419. X509_CRL_new_ex,
  420. X509_CRL_new,
  421. X509_EXTENSION_dup,
  422. X509_EXTENSION_free,
  423. X509_EXTENSION_new,
  424. X509_NAME_ENTRY_dup,
  425. X509_NAME_ENTRY_free,
  426. X509_NAME_ENTRY_new,
  427. X509_NAME_dup,
  428. X509_NAME_free,
  429. X509_NAME_new,
  430. X509_REQ_INFO_free,
  431. X509_REQ_INFO_new,
  432. X509_REQ_dup,
  433. X509_REQ_free,
  434. X509_REQ_new,
  435. X509_REQ_new_ex,
  436. X509_REVOKED_dup,
  437. X509_REVOKED_free,
  438. X509_REVOKED_new,
  439. X509_SIG_free,
  440. X509_SIG_new,
  441. X509_VAL_free,
  442. X509_VAL_new,
  443. X509_dup,
  444. \&\- ASN1 object utilities
  445. .SH "SYNOPSIS"
  446. .IX Header "SYNOPSIS"
  447. .Vb 1
  448. \& #include <openssl/asn1t.h>
  449. \&
  450. \& DECLARE_ASN1_FUNCTIONS(type)
  451. \& IMPLEMENT_ASN1_FUNCTIONS(stname)
  452. \&
  453. \& typedef struct ASN1_ITEM_st ASN1_ITEM;
  454. \&
  455. \& extern const ASN1_ITEM TYPE_it;
  456. \& TYPE *TYPE_new(void);
  457. \& TYPE *TYPE_dup(const TYPE *a);
  458. \& void TYPE_free(TYPE *a);
  459. \& int TYPE_print_ctx(BIO *out, TYPE *a, int indent, const ASN1_PCTX *pctx);
  460. .Ve
  461. .PP
  462. The following functions have been deprecated since OpenSSL 3.0, and can be
  463. hidden entirely by defining \fB\s-1OPENSSL_API_COMPAT\s0\fR with a suitable version value,
  464. see \fBopenssl_user_macros\fR\|(7):
  465. .PP
  466. .Vb 3
  467. \& DSA *DSAparams_dup(const DSA *dsa);
  468. \& RSA *RSAPrivateKey_dup(const RSA *rsa);
  469. \& RSA *RSAPublicKey_dup(const RSA *rsa);
  470. .Ve
  471. .SH "DESCRIPTION"
  472. .IX Header "DESCRIPTION"
  473. In the description below, \fB\f(BI\s-1TYPE\s0\fB\fR is used
  474. as a placeholder for any of the OpenSSL datatypes, such as \fBX509\fR.
  475. .PP
  476. The OpenSSL \s-1ASN1\s0 parsing library templates are like a data-driven bytecode
  477. interpreter.
  478. Every \s-1ASN1\s0 object as a global variable, TYPE_it, that describes the item
  479. such as its fields. (On systems which cannot export variables from shared
  480. libraries, the global is instead a function which returns a pointer to a
  481. static variable.
  482. .PP
  483. The macro \s-1\fBDECLARE_ASN1_FUNCTIONS\s0()\fR is typically used in header files
  484. to generate the function declarations.
  485. .PP
  486. The macro \s-1\fBIMPLEMENT_ASN1_FUNCTIONS\s0()\fR is used once in a source file
  487. to generate the function bodies.
  488. .PP
  489. \&\fB\f(BI\s-1TYPE\s0\fB_new\fR() allocates an empty object of the indicated type.
  490. The object returned must be released by calling \fB\f(BI\s-1TYPE\s0\fB_free\fR().
  491. .PP
  492. \&\fB\f(BI\s-1TYPE\s0\fB_new_ex\fR() is similar to \fB\f(BI\s-1TYPE\s0\fB_new\fR() but also passes the
  493. library context \fIlibctx\fR and the property query \fIpropq\fR to use when retrieving
  494. algorithms from providers. This created object can then be used when loading
  495. binary data using \fBd2i_\f(BI\s-1TYPE\s0\fB\fR().
  496. .PP
  497. \&\fB\f(BI\s-1TYPE\s0\fB_dup\fR() copies an existing object, leaving it untouched.
  498. Note, however, that the internal representation of the object
  499. may contain (besides the \s-1ASN.1\s0 structure) further data, which is not copied.
  500. For instance, an \fBX509\fR object usually is augmented by cached information
  501. on X.509v3 extensions, etc., and losing it can lead to wrong validation results.
  502. To avoid such situations, better use \fB\f(BI\s-1TYPE\s0\fB_up_ref\fR() if available.
  503. For the case of \fBX509\fR objects, an alternative to using \fBX509_up_ref\fR\|(3)
  504. may be to still call \fB\f(BI\s-1TYPE\s0\fB_dup\fR(), e.g., \fIcopied_cert = X509_dup(cert)\fR,
  505. followed by \fIX509_check_purpose(copied_cert, \-1, 0)\fR,
  506. which re-builds the cached data.
  507. .PP
  508. \&\fB\f(BI\s-1TYPE\s0\fB_free\fR() releases the object and all pointers and sub-objects
  509. within it. If the argument is \s-1NULL,\s0 nothing is done.
  510. .PP
  511. \&\fB\f(BI\s-1TYPE\s0\fB_print_ctx\fR() prints the object \fIa\fR on the specified \s-1BIO\s0 \fIout\fR.
  512. Each line will be prefixed with \fIindent\fR spaces.
  513. The \fIpctx\fR specifies the printing context and is for internal
  514. use; use \s-1NULL\s0 to get the default behavior. If a print function is
  515. user-defined, then pass in any \fIpctx\fR down to any nested calls.
  516. .SH "RETURN VALUES"
  517. .IX Header "RETURN VALUES"
  518. \&\fB\f(BI\s-1TYPE\s0\fB_new\fR(), \fB\f(BI\s-1TYPE\s0\fB_new_ex\fR() and \fB\f(BI\s-1TYPE\s0\fB_dup\fR() return a pointer to
  519. the object or \s-1NULL\s0 on failure.
  520. .PP
  521. \&\fB\f(BI\s-1TYPE\s0\fB_print_ctx\fR() returns 1 on success or zero on failure.
  522. .SH "SEE ALSO"
  523. .IX Header "SEE ALSO"
  524. \&\fBX509_up_ref\fR\|(3)
  525. .SH "HISTORY"
  526. .IX Header "HISTORY"
  527. The functions \fBX509_REQ_new_ex()\fR, \fBX509_CRL_new_ex()\fR, \fBPKCS7_new_ex()\fR and
  528. \&\fBCMS_ContentInfo_new_ex()\fR were added in OpenSSL 3.0.
  529. .PP
  530. The functions \fBDSAparams_dup()\fR, \fBRSAPrivateKey_dup()\fR and \fBRSAPublicKey_dup()\fR were
  531. deprecated in 3.0.
  532. .SH "COPYRIGHT"
  533. .IX Header "COPYRIGHT"
  534. Copyright 2016\-2024 The OpenSSL Project Authors. All Rights Reserved.
  535. .PP
  536. Licensed under the Apache License 2.0 (the \*(L"License\*(R"). You may not use
  537. this file except in compliance with the License. You can obtain a copy
  538. in the file \s-1LICENSE\s0 in the source distribution or at
  539. <https://www.openssl.org/source/license.html>.