[#CMS_add1_signer]
= CMS&lowbar;add1&lowbar;signer
:mrdocs:

Add a signer certificate and private key to a CMS SignedData ContentInfo&period;

== Synopsis

Declared in `&lt;openssl&sol;cms&period;h&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
xref:CMS_SignerInfo.adoc[CMS&lowbar;SignerInfo]*
CMS&lowbar;add1&lowbar;signer(
    xref:CMS_ContentInfo.adoc[CMS&lowbar;ContentInfo]* cms,
    xref:X509.adoc[X509]* signer,
    xref:EVP_PKEY.adoc[EVP&lowbar;PKEY]* pk,
    xref:EVP_MD.adoc[EVP&lowbar;MD] const* md,
    unsigned int flags);
----

== Description

Unless CMS&lowbar;REUSE&lowbar;DIGEST is set, the ContentInfo is incomplete until finalized by streaming or CMS&lowbar;final()&period;

== Return Value

The new CMS&lowbar;SignerInfo on success, or NULL on error&period;

== Parameters

[cols="1,4"]
|===
| Name| Description
| *cms*
| CMS&lowbar;ContentInfo that must already be SignedData (for example from CMS&lowbar;sign() with CMS&lowbar;PARTIAL)&period;
| *signer*
| Signer certificate&period;
| *pk*
| Private key corresponding to `signer&period;`
| *md*
| Message digest to use, or NULL to select the default digest for the key algorithm&period;
| *flags*
| CMS&lowbar;&ast; option flags controlling digest reuse, attributes, and finalization&period;
|===


[.small]#Created with https://www.mrdocs.com[MrDocs]#
