
#use wml::openssl-macros area=docs page=CMS_get0_SignerInfos

<title>Documents, CMS_get0_SignerInfos(3)</title>

<h1>CMS_get0_SignerInfos(3)</h1>

#use wml::imp::generic

{:
## What's this? [[s|(<STRONG>[^<].+?)</A>(</STRONG><DD>)|$1$2|sg]]
[[s|<P>\s+<P>|<P>|sg]]
[[s|<P>\s+</|</|sg]]
[[s|<DD>\s*<DT>|<DD>&nbsp;<DT>|sg]]
[[s|<DD>\s*</DL>|<DD>&nbsp;</DL>|sg]]
[[s|\[|&#91;|sg]]
[[s|\]|&#93;|sg]]

<!-- INDEX BEGIN -->

<UL>

	<LI><A HREF="#NAME">NAME</A>
	<LI><A HREF="#SYNOPSIS">SYNOPSIS</A>
	<LI><A HREF="#DESCRIPTION">DESCRIPTION</A>
	<LI><A HREF="#NOTES">NOTES</A>
	<LI><A HREF="#RETURN_VALUES">RETURN VALUES</A>
	<LI><A HREF="#SEE_ALSO">SEE ALSO</A>
	<LI><A HREF="#HISTORY">HISTORY</A>
</UL>
<!-- INDEX END -->

<HR>
<P>
<HR>
<H1><A NAME="NAME">NAME</A></H1>
<PRE> CMS_get0_SignerInfos, CMS_SignerInfo_get0_signer_id, CMS_SignerInfo_cert_cmp, CMS_set1_signer_certs - CMS signedData signer functions.
</PRE>
<P>
<HR>
<H1><A NAME="SYNOPSIS">SYNOPSIS</A></H1>
<PRE> #include &lt;openssl/cms.h&gt;
</PRE>
<PRE> STACK_OF(CMS_SignerInfo) *CMS_get0_SignerInfos(CMS_ContentInfo *cms);
</PRE>
<PRE> int CMS_SignerInfo_get0_signer_id(CMS_SignerInfo *si, ASN1_OCTET_STRING **keyid, X509_NAME **issuer, ASN1_INTEGER **sno);
 int CMS_SignerInfo_cert_cmp(CMS_SignerInfo *si, X509 *cert);
 void CMS_SignerInfo_set1_signer_cert(CMS_SignerInfo *si, X509 *signer);
</PRE>
<P>
<HR>
<H1><A NAME="DESCRIPTION">DESCRIPTION</A></H1>
<P>
The function <CODE>CMS_get0_SignerInfos()</CODE> returns all the
CMS_SignerInfo structures associated with a CMS signedData structure.

</P>
<P>
<CODE>CMS_SignerInfo_get0_signer_id()</CODE> retrieves the certificate
signer identifier associated with a specific CMS_SignerInfo structure <STRONG>si</STRONG>. Either the keyidentifier will be set in <STRONG>keyid</STRONG> or <STRONG>both</STRONG> issuer name and serial number in <STRONG>issuer</STRONG> and <STRONG>sno</STRONG>.

</P>
<P>
<CODE>CMS_SignerInfo_cert_cmp()</CODE> compares the certificate <STRONG>cert</STRONG> against the signer identifier <STRONG>si</STRONG>. It returns zero if the comparison is successful and non zero if not.

</P>
<P>
<CODE>CMS_SignerInfo_set1_signer_cert()</CODE> sets the signers certificate
of <STRONG>si</STRONG> to
<STRONG>signer</STRONG>.

</P>
<P>
<HR>
<H1><A NAME="NOTES">NOTES</A></H1>
<P>
The main purpose of these functions is to enable an application to lookup
signers certificates using any appropriate technique when the simpler
method of <CODE>CMS_verify()</CODE> is not appropriate.

</P>
<P>
In typical usage and application will retrieve all CMS_SignerInfo
structures using <CODE>CMS_get0_SignerInfo()</CODE> and retrieve the
identifier information using CMS. It will then obtain the signer
certificate by some unspecified means (or return and error if it cannot be
found) and set it using <CODE>CMS_SignerInfo_set1_signer_cert().</CODE>

</P>
<P>
Once all signer certificates have been set <CODE>CMS_verify()</CODE> can be
used.

</P>
<P>
Although <CODE>CMS_get0_SignerInfos()</CODE> can return NULL is an error
occur <STRONG>or</STRONG> if there are no signers this is not a problem in practice because the only
error which can occur is if the <STRONG>cms</STRONG> structure is not of type signedData due to application error.

</P>
<P>
<HR>
<H1><A NAME="RETURN_VALUES">RETURN VALUES</A></H1>
<P>
<CODE>CMS_get0_SignerInfos()</CODE> returns all CMS_SignerInfo structures,
or NULL there are no signers or an error occurs.

</P>
<P>
<CODE>CMS_SignerInfo_get0_signer_id()</CODE> returns 1 for success and 0
for failure.

</P>
<P>
<CODE>CMS_SignerInfo_cert_cmp()</CODE> returns 0 for a successful
comparison and non zero otherwise.

</P>
<P>
<CODE>CMS_SignerInfo_set1_signer_cert()</CODE> does not return a value.

</P>
<P>
Any error can be obtained from <A HREF="../crypto/ERR_get_error.html#">ERR_get_error(3)</A>



</P>
<P>
<HR>
<H1><A NAME="SEE_ALSO">SEE ALSO</A></H1>
<P>
<A HREF="../crypto/ERR_get_error.html#">ERR_get_error(3)</A>, <A HREF="../crypto/CMS_verify.html#">CMS_verify(3)</A>



</P>
<P>
<HR>
<H1><A NAME="HISTORY">HISTORY</A></H1>
<P>
These functions were first was added to OpenSSL 0.9.8

</P>
:}


