[#CMS_add0_recipient_password]
= CMS&lowbar;add0&lowbar;recipient&lowbar;password
:mrdocs:

Add a PasswordRecipientInfo that derives a KEK from a password&period;

== Synopsis

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

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
xref:CMS_RecipientInfo.adoc[CMS&lowbar;RecipientInfo]*
CMS&lowbar;add0&lowbar;recipient&lowbar;password(
    xref:CMS_ContentInfo.adoc[CMS&lowbar;ContentInfo]* cms,
    int iter,
    int wrap&lowbar;nid,
    int pbe&lowbar;nid,
    unsigned char* pass,
    ssize&lowbar;t passlen,
    xref:EVP_CIPHER-07.adoc[EVP&lowbar;CIPHER] const* kekciph);
----

== Return Value

Internal pointer to the new CMS&lowbar;RecipientInfo, or NULL on error&period;

== Parameters

[cols="1,4"]
|===
| Name| Description
| *cms*
| Enveloped ContentInfo created with CMS&lowbar;PARTIAL&period;
| *iter*
| PBKDF2 iteration count, or a non&hyphen;positive value for the default&period;
| *wrap&lowbar;nid*
| Password&hyphen;based key&hyphen;wrap algorithm NID, or &lt;&equals; 0 for NID&lowbar;id&lowbar;alg&lowbar;PWRI&lowbar;KEK&period;
| *pbe&lowbar;nid*
| Password&hyphen;based KDF NID, or &lt;&equals; 0 for NID&lowbar;id&lowbar;pbkdf2&period;
| *pass*
| Password bytes&semi; ownership transfers to `cms` (may be set later via CMS&lowbar;RecipientInfo&lowbar;set0&lowbar;password)&period;
| *passlen*
| Length of `pass` in octets, or a negative value if `pass` is a NUL&hyphen;terminated string&period;
| *kekciph*
| Cipher used to wrap the content&hyphen;encryption key&semi; NULL uses the enveloped content cipher&period;
|===


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