CMS_get0_SignerInfos.3ossl 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143
  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 "CMS_GET0_SIGNERINFOS 3ossl"
  58. .TH CMS_GET0_SIGNERINFOS 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. CMS_SignerInfo_set1_signer_cert,
  65. CMS_get0_SignerInfos, CMS_SignerInfo_get0_signer_id,
  66. CMS_SignerInfo_get0_signature, CMS_SignerInfo_cert_cmp
  67. \&\- CMS signedData signer functions
  68. .SH SYNOPSIS
  69. .IX Header "SYNOPSIS"
  70. .Vb 1
  71. \& #include <openssl/cms.h>
  72. \&
  73. \& STACK_OF(CMS_SignerInfo) *CMS_get0_SignerInfos(CMS_ContentInfo *cms);
  74. \&
  75. \& int CMS_SignerInfo_get0_signer_id(CMS_SignerInfo *si, ASN1_OCTET_STRING **keyid,
  76. \& X509_NAME **issuer, ASN1_INTEGER **sno);
  77. \& ASN1_OCTET_STRING *CMS_SignerInfo_get0_signature(CMS_SignerInfo *si);
  78. \& int CMS_SignerInfo_cert_cmp(CMS_SignerInfo *si, X509 *cert);
  79. \& void CMS_SignerInfo_set1_signer_cert(CMS_SignerInfo *si, X509 *signer);
  80. .Ve
  81. .SH DESCRIPTION
  82. .IX Header "DESCRIPTION"
  83. The function \fBCMS_get0_SignerInfos()\fR returns all the CMS_SignerInfo structures
  84. associated with a CMS signedData structure.
  85. .PP
  86. \&\fBCMS_SignerInfo_get0_signer_id()\fR retrieves the certificate signer identifier
  87. associated with a specific CMS_SignerInfo structure \fBsi\fR. Either the
  88. keyidentifier will be set in \fBkeyid\fR or \fBboth\fR issuer name and serial number
  89. in \fBissuer\fR and \fBsno\fR.
  90. .PP
  91. \&\fBCMS_SignerInfo_get0_signature()\fR retrieves the signature associated with
  92. \&\fBsi\fR in a pointer to an ASN1_OCTET_STRING structure. This pointer returned
  93. corresponds to the internal signature value if \fBsi\fR so it may be read or
  94. modified.
  95. .PP
  96. \&\fBCMS_SignerInfo_cert_cmp()\fR compares the certificate \fBcert\fR against the signer
  97. identifier \fBsi\fR. It returns zero if the comparison is successful and non zero
  98. if not.
  99. .PP
  100. \&\fBCMS_SignerInfo_set1_signer_cert()\fR sets the signers certificate of \fBsi\fR to
  101. \&\fBsigner\fR.
  102. .SH NOTES
  103. .IX Header "NOTES"
  104. The main purpose of these functions is to enable an application to lookup
  105. signers certificates using any appropriate technique when the simpler method
  106. of \fBCMS_verify()\fR is not appropriate.
  107. .PP
  108. In typical usage and application will retrieve all CMS_SignerInfo structures
  109. using \fBCMS_get0_SignerInfo()\fR and retrieve the identifier information using
  110. CMS. It will then obtain the signer certificate by some unspecified means
  111. (or return and error if it cannot be found) and set it using
  112. \&\fBCMS_SignerInfo_set1_signer_cert()\fR.
  113. .PP
  114. Once all signer certificates have been set \fBCMS_verify()\fR can be used.
  115. .PP
  116. Although \fBCMS_get0_SignerInfos()\fR can return NULL if an error occurs \fBor\fR if
  117. there are no signers this is not a problem in practice because the only
  118. error which can occur is if the \fBcms\fR structure is not of type signedData
  119. due to application error.
  120. .SH "RETURN VALUES"
  121. .IX Header "RETURN VALUES"
  122. \&\fBCMS_get0_SignerInfos()\fR returns all CMS_SignerInfo structures, or NULL there
  123. are no signers or an error occurs.
  124. .PP
  125. \&\fBCMS_SignerInfo_get0_signer_id()\fR returns 1 for success and 0 for failure.
  126. .PP
  127. \&\fBCMS_SignerInfo_cert_cmp()\fR returns 0 for a successful comparison and non
  128. zero otherwise.
  129. .PP
  130. \&\fBCMS_SignerInfo_set1_signer_cert()\fR does not return a value.
  131. .PP
  132. Any error can be obtained from \fBERR_get_error\fR\|(3)
  133. .SH "SEE ALSO"
  134. .IX Header "SEE ALSO"
  135. \&\fBERR_get_error\fR\|(3), \fBCMS_verify\fR\|(3)
  136. .SH COPYRIGHT
  137. .IX Header "COPYRIGHT"
  138. Copyright 2008\-2018 The OpenSSL Project Authors. All Rights Reserved.
  139. .PP
  140. Licensed under the Apache License 2.0 (the "License"). You may not use
  141. this file except in compliance with the License. You can obtain a copy
  142. in the file LICENSE in the source distribution or at
  143. <https://www.openssl.org/source/license.html>.