CMS_add1_recipient_cert(3) OpenSSL CMS_add1_recipient_cert(3) NNAAMMEE CMS_add1_recipient_cert, CMS_add0_recipient_key - add recipients to a CMS enveloped data structure SSYYNNOOPPSSIISS #include CMS_RecipientInfo *CMS_add1_recipient_cert(CMS_ContentInfo *cms, X509 *recip, unsigned int flags); CMS_RecipientInfo *CMS_add0_recipient_key(CMS_ContentInfo *cms, int nid, unsigned char *key, size_t keylen, unsigned char *id, size_t idlen, ASN1_GENERALIZEDTIME *date, ASN1_OBJECT *otherTypeId, ASN1_TYPE *otherType); DDEESSCCRRIIPPTTIIOONN _C_M_S___a_d_d_1___r_e_c_i_p_i_e_n_t___c_e_r_t_(_) adds recipient rreecciipp to CMS_ContentInfo enveloped data structure ccmmss as a KeyTransRecipientInfo structure. _C_M_S___a_d_d_0___r_e_c_i_p_i_e_n_t___k_e_y_(_) adds symmetric key kkeeyy of length kkeeyylleenn using wrapping algorithm nniidd, identifier iidd of length iiddlleenn and optional val- ues ddaattee, ootthheerrTTyyppeeIIdd and ootthheerrTTyyppee to CMS_ContentInfo enveloped data structure ccmmss as a KEKRecipientInfo structure. The CMS_ContentInfo structure should be obtained from an initial call to _C_M_S___e_n_c_r_y_p_t_(_) with the flag CCMMSS__PPAARRTTIIAALL set. NNOOTTEESS The main purpose of this function is to provide finer control over a CMS enveloped data structure where the simpler _C_M_S___e_n_c_r_y_p_t_(_) function defaults are not appropriate. For example if one or more KEKRecipi- entInfo structures need to be added. New attributes can also be added using the returned CMS_RecipientInfo structure and the CMS attribute utility functions. OpenSSL will by default identify recipient certificates using issuer name and serial number. If CCMMSS__UUSSEE__KKEEYYIIDD is set it will use the subject key identifier value instead. An error occurs if all recipient certifi- cates do not have a subject key identifier extension. Currently only AES based key wrapping algorithms are supported for nniidd, specifically: NID_id_aes128_wrap, NID_id_aes192_wrap and NID_id_aes256_wrap. If nniidd is set to NNIIDD__uunnddeeff then an AES wrap algo- rithm will be used consistent with kkeeyylleenn. RREETTUURRNN VVAALLUUEESS _C_M_S___a_d_d_1___r_e_c_i_p_i_e_n_t___c_e_r_t_(_) and _C_M_S___a_d_d_0___r_e_c_i_p_i_e_n_t___k_e_y_(_) return an inter- nal pointer to the CMS_RecipientInfo structure just added or NULL if an error occurs. SSEEEE AALLSSOO _E_R_R___g_e_t___e_r_r_o_r(3), _C_M_S___d_e_c_r_y_p_t(3), _C_M_S___f_i_n_a_l(3), HHIISSTTOORRYY _C_M_S___a_d_d_1___r_e_c_i_p_i_e_n_t___c_e_r_t_(_) and _C_M_S___a_d_d_0___r_e_c_i_p_i_e_n_t___k_e_y_(_) were added to OpenSSL 0.9.8 1.0.1u 2016-09-22 CMS_add1_recipient_cert(3)