PKCS12_SAFEBAG_get1_cert.3ossl 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142
  1. .\" -*- mode: troff; coding: utf-8 -*-
  2. .\" Automatically generated by Pod::Man 5.01 (Pod::Simple 3.43)
  3. .\"
  4. .\" Standard preamble:
  5. .\" ========================================================================
  6. .de Sp \" Vertical space (when we can't use .PP)
  7. .if t .sp .5v
  8. .if n .sp
  9. ..
  10. .de Vb \" Begin verbatim text
  11. .ft CW
  12. .nf
  13. .ne \\$1
  14. ..
  15. .de Ve \" End verbatim text
  16. .ft R
  17. .fi
  18. ..
  19. .\" \*(C` and \*(C' are quotes in nroff, nothing in troff, for use with C<>.
  20. .ie n \{\
  21. . ds C` ""
  22. . ds C' ""
  23. 'br\}
  24. .el\{\
  25. . ds C`
  26. . ds C'
  27. 'br\}
  28. .\"
  29. .\" Escape single quotes in literal strings from groff's Unicode transform.
  30. .ie \n(.g .ds Aq \(aq
  31. .el .ds Aq '
  32. .\"
  33. .\" If the F register is >0, we'll generate index entries on stderr for
  34. .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index
  35. .\" entries marked with X<> in POD. Of course, you'll have to process the
  36. .\" output yourself in some meaningful fashion.
  37. .\"
  38. .\" Avoid warning from groff about undefined register 'F'.
  39. .de IX
  40. ..
  41. .nr rF 0
  42. .if \n(.g .if rF .nr rF 1
  43. .if (\n(rF:(\n(.g==0)) \{\
  44. . if \nF \{\
  45. . de IX
  46. . tm Index:\\$1\t\\n%\t"\\$2"
  47. ..
  48. . if !\nF==2 \{\
  49. . nr % 0
  50. . nr F 2
  51. . \}
  52. . \}
  53. .\}
  54. .rr rF
  55. .\" ========================================================================
  56. .\"
  57. .IX Title "PKCS12_SAFEBAG_GET1_CERT 3ossl"
  58. .TH PKCS12_SAFEBAG_GET1_CERT 3ossl 2025-01-17 3.4.0 OpenSSL
  59. .\" For nroff, turn off justification. Always turn off hyphenation; it makes
  60. .\" way too many mistakes in technical documents.
  61. .if n .ad l
  62. .nh
  63. .SH NAME
  64. PKCS12_SAFEBAG_get0_attr, PKCS12_SAFEBAG_get0_type,
  65. PKCS12_SAFEBAG_get_nid, PKCS12_SAFEBAG_get_bag_nid,
  66. PKCS12_SAFEBAG_get0_bag_obj, PKCS12_SAFEBAG_get0_bag_type,
  67. PKCS12_SAFEBAG_get1_cert_ex, PKCS12_SAFEBAG_get1_cert,
  68. PKCS12_SAFEBAG_get1_crl_ex, PKCS12_SAFEBAG_get1_crl,
  69. PKCS12_SAFEBAG_get0_safes, PKCS12_SAFEBAG_get0_p8inf,
  70. PKCS12_SAFEBAG_get0_pkcs8 \- Get objects from a PKCS#12 safeBag
  71. .SH SYNOPSIS
  72. .IX Header "SYNOPSIS"
  73. .Vb 1
  74. \& #include <openssl/pkcs12.h>
  75. \&
  76. \& const ASN1_TYPE *PKCS12_SAFEBAG_get0_attr(const PKCS12_SAFEBAG *bag,
  77. \& int attr_nid);
  78. \& const ASN1_OBJECT *PKCS12_SAFEBAG_get0_type(const PKCS12_SAFEBAG *bag);
  79. \& int PKCS12_SAFEBAG_get_nid(const PKCS12_SAFEBAG *bag);
  80. \& int PKCS12_SAFEBAG_get_bag_nid(const PKCS12_SAFEBAG *bag);
  81. \& const ASN1_TYPE *PKCS12_SAFEBAG_get0_bag_obj(const PKCS12_SAFEBAG *bag);
  82. \& const ASN1_OBJECT *PKCS12_SAFEBAG_get0_bag_type(const PKCS12_SAFEBAG *bag);
  83. \& X509_CRL *PKCS12_SAFEBAG_get1_cert_ex(const PKCS12_SAFEBAG *bag,
  84. \& OSSL_LIB_CTX *libctx, const char *propq);
  85. \& X509 *PKCS12_SAFEBAG_get1_cert(const PKCS12_SAFEBAG *bag);
  86. \& X509_CRL *PKCS12_SAFEBAG_get1_crl_ex(const PKCS12_SAFEBAG *bag,
  87. \& OSSL_LIB_CTX *libctx, const char *propq);
  88. \& X509_CRL *PKCS12_SAFEBAG_get1_crl(const PKCS12_SAFEBAG *bag);
  89. \& const STACK_OF(PKCS12_SAFEBAG) *PKCS12_SAFEBAG_get0_safes(const PKCS12_SAFEBAG *bag);
  90. \& const PKCS8_PRIV_KEY_INFO *PKCS12_SAFEBAG_get0_p8inf(const PKCS12_SAFEBAG *bag);
  91. \& const X509_SIG *PKCS12_SAFEBAG_get0_pkcs8(const PKCS12_SAFEBAG *bag);
  92. .Ve
  93. .SH DESCRIPTION
  94. .IX Header "DESCRIPTION"
  95. \&\fBPKCS12_SAFEBAG_get0_attr()\fR gets the attribute value corresponding to the \fBattr_nid\fR.
  96. .PP
  97. \&\fBPKCS12_SAFEBAG_get0_type()\fR gets the \fBsafeBag\fR type as an OID, whereas
  98. \&\fBPKCS12_SAFEBAG_get_nid()\fR gets the \fBsafeBag\fR type as an NID, which could be
  99. \&\fBNID_certBag\fR, \fBNID_crlBag\fR, \fBNID_keyBag\fR, \fBNID_secretBag\fR, \fBNID_safeContentsBag\fR
  100. or \fBNID_pkcs8ShroudedKeyBag\fR.
  101. .PP
  102. \&\fBPKCS12_SAFEBAG_get_bag_nid()\fR gets the type of the object contained within the
  103. \&\fBPKCS12_SAFEBAG\fR. This corresponds to the bag type for most bags, but can be
  104. arbitrary for \fBsecretBag\fRs. \fBPKCS12_SAFEBAG_get0_bag_type()\fR gets this type as an OID.
  105. .PP
  106. \&\fBPKCS12_SAFEBAG_get0_bag_obj()\fR retrieves the object contained within the safeBag.
  107. .PP
  108. \&\fBPKCS12_SAFEBAG_get1_cert_ex()\fR and \fBPKCS12_SAFEBAG_get1_crl_ex()\fR return new \fBX509\fR or
  109. \&\fBX509_CRL\fR objects from the item in the safeBag. \fIlibctx\fR and \fIpropq\fR are used when
  110. fetching algorithms, and may optionally be set to NULL.
  111. .PP
  112. \&\fBPKCS12_SAFEBAG_get1_cert()\fR and \fBPKCS12_SAFEBAG_get1_crl()\fR are the same as
  113. \&\fBPKCS12_SAFEBAG_get1_cert_ex()\fR and \fBPKCS12_SAFEBAG_get1_crl_ex()\fR and set the \fIlibctx\fR and
  114. \&\fIprop\fR to NULL. This will use the default library context.
  115. .PP
  116. \&\fBPKCS12_SAFEBAG_get0_p8inf()\fR and \fBPKCS12_SAFEBAG_get0_pkcs8()\fR return the PKCS8 object
  117. from a PKCS8shroudedKeyBag or a keyBag.
  118. .PP
  119. \&\fBPKCS12_SAFEBAG_get0_safes()\fR retrieves the set of \fBsafeBags\fR contained within a
  120. safeContentsBag.
  121. .SH "RETURN VALUES"
  122. .IX Header "RETURN VALUES"
  123. \&\fBPKCS12_SAFEBAG_get_nid()\fR and \fBPKCS12_SAFEBAG_get_bag_nid()\fR return the NID of the safeBag
  124. or bag object, or \-1 if there is no corresponding NID.
  125. Other functions return a valid object of the specified type or NULL if an error occurred.
  126. .SH "SEE ALSO"
  127. .IX Header "SEE ALSO"
  128. \&\fBPKCS12_create\fR\|(3),
  129. \&\fBPKCS12_add_safe\fR\|(3),
  130. \&\fBPKCS12_add_safes\fR\|(3)
  131. .SH HISTORY
  132. .IX Header "HISTORY"
  133. The functions \fBPKCS12_SAFEBAG_get1_cert_ex()\fR and \fBPKCS12_SAFEBAG_get1_crl_ex()\fR were
  134. added in OpenSSL 3.2.
  135. .SH COPYRIGHT
  136. .IX Header "COPYRIGHT"
  137. Copyright 2019\-2023 The OpenSSL Project Authors. All Rights Reserved.
  138. .PP
  139. Licensed under the Apache License 2.0 (the "License"). You may not use
  140. this file except in compliance with the License. You can obtain a copy
  141. in the file LICENSE in the source distribution or at
  142. <https://www.openssl.org/source/license.html>.