SMIME_read_PKCS7(3) OpenSSL SMIME_read_PKCS7(3) NNAAMMEE SMIME_read_PKCS7 - parse S/MIME message. SSYYNNOOPPSSIISS #include PKCS7 *SMIME_read_PKCS7(BIO *in, BIO **bcont); DDEESSCCRRIIPPTTIIOONN _S_M_I_M_E___r_e_a_d___P_K_C_S_7_(_) 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 NNUULLLL. The parsed PKCS#7 structure is returned or NNUULLLL if an error occurred. NNOOTTEESS If **bbccoonntt is not NNUULLLL then the message is clear text signed. **bbccoonntt can then be passed to _P_K_C_S_7___v_e_r_i_f_y_(_) with the PPKKCCSS77__DDEETTAACCHHEEDD flag set. Otherwise the type of the returned structure can be determined using _P_K_C_S_7___t_y_p_e_(_). To support future functionality if bbccoonntt is not NNUULLLL **bbccoonntt should be initialized to NNUULLLL. For example: BIO *cont = NULL; PKCS7 *p7; p7 = SMIME_read_PKCS7(in, &cont); BBUUGGSS The MIME parser used by _S_M_I_M_E___r_e_a_d___P_K_C_S_7_(_) is somewhat primitive. While it will handle most S/MIME messages more complex compound formats may not work. The parser assumes that the PKCS7 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___P_K_C_S_7_(_) returns a valid PPKKCCSS77 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), _P_K_C_S_7___t_y_p_e(3) _S_M_I_M_E___r_e_a_d___P_K_C_S_7(3), _P_K_C_S_7___s_i_g_n(3), _P_K_C_S_7___v_e_r_i_f_y(3), _P_K_C_S_7___e_n_c_r_y_p_t(3) _P_K_C_S_7___d_e_c_r_y_p_t(3) HHIISSTTOORRYY _S_M_I_M_E___r_e_a_d___P_K_C_S_7_(_) was added to OpenSSL 0.9.5 1.0.2u 2019-12-20 SMIME_read_PKCS7(3)