SMIME_read_CMS.pod 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  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)>, L<CMS_type(3)>
  38. L<SMIME_read_CMS(3)>, L<CMS_sign(3)>,
  39. L<CMS_verify(3)>, L<CMS_encrypt(3)>
  40. L<CMS_decrypt(3)>
  41. =head1 COPYRIGHT
  42. Copyright 2008-2016 The OpenSSL Project Authors. All Rights Reserved.
  43. Licensed under the OpenSSL license (the "License"). You may not use
  44. this file except in compliance with the License. You can obtain a copy
  45. in the file LICENSE in the source distribution or at
  46. L<https://www.openssl.org/source/license.html>.
  47. =cut