2
0

SMIME_read_CMS.pod 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. =pod
  2. =head1 NAME
  3. SMIME_read_CMS - parse S/MIME message.
  4. =head1 SYNOPSIS
  5. #include <openssl/cms.h>
  6. CMS_ContentInfo *SMIME_read_CMS(BIO *in, BIO **bcont);
  7. =head1 DESCRIPTION
  8. SMIME_read_CMS() parses a message in S/MIME format.
  9. B<in> is a BIO to read the message from.
  10. If cleartext signing is used then the content is saved in a memory bio which is
  11. written to B<*bcont>, otherwise B<*bcont> is set to NULL.
  12. The parsed CMS_ContentInfo structure is returned or NULL if an
  13. error occurred.
  14. =head1 NOTES
  15. If B<*bcont> is not NULL then the message is clear text signed. B<*bcont> can
  16. then be passed to CMS_verify() with the B<CMS_DETACHED> flag set.
  17. Otherwise the type of the returned structure can be determined
  18. using CMS_get0_type().
  19. To support future functionality if B<bcont> is not NULL B<*bcont> should be
  20. initialized to NULL. For example:
  21. BIO *cont = NULL;
  22. CMS_ContentInfo *cms;
  23. cms = SMIME_read_CMS(in, &cont);
  24. =head1 BUGS
  25. The MIME parser used by SMIME_read_CMS() is somewhat primitive. While it will
  26. handle most S/MIME messages more complex compound formats may not work.
  27. The parser assumes that the CMS_ContentInfo structure is always base64 encoded
  28. and will not handle the case where it is in binary format or uses quoted
  29. printable format.
  30. The use of a memory BIO to hold the signed content limits the size of message
  31. which can be processed due to memory restraints: a streaming single pass option
  32. should be available.
  33. =head1 RETURN VALUES
  34. SMIME_read_CMS() returns a valid B<CMS_ContentInfo> structure or B<NULL>
  35. if an error occurred. The error can be obtained from ERR_get_error(3).
  36. =head1 SEE ALSO
  37. L<ERR_get_error(3)|ERR_get_error(3)>, L<CMS_type(3)|CMS_type(3)>
  38. L<SMIME_read_CMS(3)|SMIME_read_CMS(3)>, L<CMS_sign(3)|CMS_sign(3)>,
  39. L<CMS_verify(3)|CMS_verify(3)>, L<CMS_encrypt(3)|CMS_encrypt(3)>
  40. L<CMS_decrypt(3)|CMS_decrypt(3)>
  41. =head1 HISTORY
  42. SMIME_read_CMS() was added to OpenSSL 0.9.8
  43. =cut