5 SMIME_read_PKCS7 - parse S/MIME message.
9 PKCS7 *SMIME_read_PKCS7(BIO *in, BIO **bcont);
13 SMIME_read_PKCS7() parses a message in S/MIME format.
15 B<in> is a BIO to read the message from.
17 If cleartext signing is used then the content is saved in
18 a memory bio which is written to B<*bcont>, otherwise
19 B<*bcont> is set to B<NULL>.
21 The parsed PKCS#7 structure is returned or B<NULL> if an
26 If B<*bcont> is not B<NULL> then the message is clear text
27 signed. B<*bcont> can then be passed to PKCS7_verify() with
28 the B<PKCS7_DETACHED> flag set.
30 Otherwise the type of the returned structure can be determined
33 To support future functionality if B<bcont> is not B<NULL>
34 B<*bcont> should be initialized to B<NULL>. For example:
39 p7 = SMIME_read_PKCS7(in, &cont);
43 The MIME parser used by SMIME_read_PKCS7() is somewhat primitive.
44 While it will handle most S/MIME messages more complex compound
47 The parser assumes that the PKCS7 structure is always base64
48 encoded and will not handle the case where it is in binary format
49 or uses quoted printable format.
51 The use of a memory BIO to hold the signed content limits the size
52 of message which can be processed due to memory restraints: a
53 streaming single pass option should be available.
57 SMIME_read_PKCS7() returns a valid B<PKCS7> structure or B<NULL>
58 is an error occurred. The error can be obtained from ERR_get_error(3).
62 L<ERR_get_error(3)|ERR_get_error(3)>, L<PKCS7_type(3)|PKCS7_type(3)>
63 L<SMIME_read_PKCS7(3)|SMIME_read_PKCS7(3)>, L<PKCS7_sign(3)|PKCS7_sign(3)>,
64 L<PKCS7_verify(3)|PKCS7_verify(3)>, L<PKCS7_encrypt(3)|PKCS7_encrypt(3)>
65 L<PKCS7_decrypt(3)|PKCS7_decrypt(3)>
69 SMIME_read_PKCS7() was added to OpenSSL 0.9.5