SMIME_write_CMS(3) OpenSSL SMIME_write_CMS(3) NNAAMMEE SMIME_write_CMS - convert CMS structure to S/MIME format. SSYYNNOOPPSSIISS #include int SMIME_write_CMS(BIO *out, CMS_ContentInfo *cms, BIO *data, int flags); DDEESSCCRRIIPPTTIIOONN _S_M_I_M_E___w_r_i_t_e___C_M_S_(_) adds the appropriate MIME headers to a CMS structure to produce an S/MIME message. oouutt is the BIO to write the data to. ccmmss is the appropriate CCMMSS__CCoonn-- tteennttIInnffoo structure. If streaming is enabled then the content must be supplied in the ddaattaa argument. ffllaaggss is an optional set of flags. NNOOTTEESS The following flags can be passed in the ffllaaggss parameter. If CCMMSS__DDEETTAACCHHEEDD is set then cleartext signing will be used, this option only makes sense for SignedData where CCMMSS__DDEETTAACCHHEEDD is also set when _C_M_S___s_i_g_n_(_) is called. If the CCMMSS__TTEEXXTT flag is set MIME headers for type tteexxtt//ppllaaiinn are added to the content, this only makes sense if CCMMSS__DDEETTAACCHHEEDD is also set. If the CCMMSS__SSTTRREEAAMM flag is set streaming is performed. This flag should only be set if CCMMSS__SSTTRREEAAMM was also set in the previous call to a CMS_ContentInfo creation function. If cleartext signing is being used and CCMMSS__SSTTRREEAAMM not set then the data must be read twice: once to compute the signature in _C_M_S___s_i_g_n_(_) and once to output the S/MIME message. If streaming is performed the content is output in BER format using indefinite length constructed encoding except in the case of signed data with detached content where the content is absent and DER format is used. BBUUGGSS _S_M_I_M_E___w_r_i_t_e___C_M_S_(_) always base64 encodes CMS structures, there should be an option to disable this. RREETTUURRNN VVAALLUUEESS _S_M_I_M_E___w_r_i_t_e___C_M_S_(_) returns 1 for success or 0 for failure. SSEEEE AALLSSOO _E_R_R___g_e_t___e_r_r_o_r(3), _C_M_S___s_i_g_n(3), _C_M_S___v_e_r_i_f_y(3), _C_M_S___e_n_c_r_y_p_t(3) _C_M_S___d_e_c_r_y_p_t(3) HHIISSTTOORRYY _S_M_I_M_E___w_r_i_t_e___C_M_S_(_) was added to OpenSSL 0.9.8 1.0.1u 2016-09-22 SMIME_write_CMS(3)