SMIME_read_CMS(3) OpenSSL SMIME_read_CMS(3) NNAAMMEE SMIME_read_CMS - parse S/MIME message. SSYYNNOOPPSSIISS #include CMS_ContentInfo *SMIME_read_CMS(BIO *in, BIO **bcont); DDEESSCCRRIIPPTTIIOONN _S_M_I_M_E___r_e_a_d___C_M_S_(_) parses a message in S/MIME format. iinn is a BIO to read the message from. If cleartext signing is used then the content is saved in a memory bio which is written to **bbccoonntt, otherwise **bbccoonntt is set to NULL. The parsed CMS_ContentInfo structure is returned or NULL if an error occurred. NNOOTTEESS If **bbccoonntt is not NULL then the message is clear text signed. **bbccoonntt can then be passed to _C_M_S___v_e_r_i_f_y_(_) with the CCMMSS__DDEETTAACCHHEEDD flag set. Otherwise the type of the returned structure can be determined using _C_M_S___g_e_t_0___t_y_p_e_(_). To support future functionality if bbccoonntt is not NULL **bbccoonntt should be initialized to NULL. For example: BIO *cont = NULL; CMS_ContentInfo *cms; cms = SMIME_read_CMS(in, &cont); BBUUGGSS The MIME parser used by _S_M_I_M_E___r_e_a_d___C_M_S_(_) is somewhat primitive. While it will handle most S/MIME messages more complex compound formats may not work. The parser assumes that the CMS_ContentInfo structure is always base64 encoded and will not handle the case where it is in binary format or uses quoted printable format. The use of a memory BIO to hold the signed content limits the size of message which can be processed due to memory restraints: a streaming single pass option should be available. RREETTUURRNN VVAALLUUEESS _S_M_I_M_E___r_e_a_d___C_M_S_(_) returns a valid CCMMSS__CCoonntteennttIInnffoo structure or NNUULLLL if an error occurred. The error can be obtained from _E_R_R___g_e_t___e_r_r_o_r(3). SSEEEE AALLSSOO _E_R_R___g_e_t___e_r_r_o_r(3), _C_M_S___t_y_p_e(3) _S_M_I_M_E___r_e_a_d___C_M_S(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___r_e_a_d___C_M_S_(_) was added to OpenSSL 0.9.8 1.0.2u 2019-12-20 SMIME_read_CMS(3)