[#CMS_SharedInfo_encode]
= CMS&lowbar;SharedInfo&lowbar;encode
:mrdocs:

DER&hyphen;encode a CMS SharedInfo structure used in key&hyphen;encryption key derivation&period;

== Synopsis

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

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
int
CMS&lowbar;SharedInfo&lowbar;encode(
    unsigned char** pder,
    xref:X509_ALGOR.adoc[X509&lowbar;ALGOR]* kekalg,
    xref:ASN1_OCTET_STRING.adoc[ASN1&lowbar;OCTET&lowbar;STRING]* ukm,
    int keylen);
----

== Return Value

Length of the DER encoding, or a negative value on error&period;

== Parameters

[cols="1,4"]
|===
| Name| Description
| *pder*
| Receives a newly allocated DER encoding on success&semi; free with OPENSSL&lowbar;free&period;
| *kekalg*
| Key&hyphen;encryption algorithm identifier placed in SharedInfo&period;
| *ukm*
| Optional user keying material OCTET STRING, or NULL&period;
| *keylen*
| Length in bytes of the KEK being derived (encoded as a 4&hyphen;byte INTEGER)&period;
|===


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