SMIME_write_PKCS7.pod 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. =pod
  2. =head1 NAME
  3. SMIME_write_PKCS7 - convert PKCS#7 structure to S/MIME format
  4. =head1 SYNOPSIS
  5. #include <openssl/pkcs7.h>
  6. int SMIME_write_PKCS7(BIO *out, PKCS7 *p7, BIO *data, int flags);
  7. =head1 DESCRIPTION
  8. SMIME_write_PKCS7() adds the appropriate MIME headers to a PKCS#7
  9. structure to produce an S/MIME message.
  10. B<out> is the BIO to write the data to. B<p7> is the appropriate B<PKCS7>
  11. structure. If streaming is enabled then the content must be supplied in the
  12. B<data> argument. B<flags> is an optional set of flags.
  13. =head1 NOTES
  14. The following flags can be passed in the B<flags> parameter.
  15. If B<PKCS7_DETACHED> is set then cleartext signing will be used,
  16. this option only makes sense for signedData where B<PKCS7_DETACHED>
  17. is also set when PKCS7_sign() is also called.
  18. If the B<PKCS7_TEXT> flag is set MIME headers for type B<text/plain>
  19. are added to the content, this only makes sense if B<PKCS7_DETACHED>
  20. is also set.
  21. If the B<PKCS7_STREAM> flag is set streaming is performed. This flag should
  22. only be set if B<PKCS7_STREAM> was also set in the previous call to
  23. PKCS7_sign() or PKCS7_encrypt().
  24. If cleartext signing is being used and B<PKCS7_STREAM> not set then
  25. the data must be read twice: once to compute the signature in PKCS7_sign()
  26. and once to output the S/MIME message.
  27. If streaming is performed the content is output in BER format using indefinite
  28. length constructed encoding except in the case of signed data with detached
  29. content where the content is absent and DER format is used.
  30. =head1 BUGS
  31. SMIME_write_PKCS7() always base64 encodes PKCS#7 structures, there
  32. should be an option to disable this.
  33. =head1 RETURN VALUES
  34. SMIME_write_PKCS7() returns 1 for success or 0 for failure.
  35. =head1 SEE ALSO
  36. L<ERR_get_error(3)>, L<PKCS7_sign(3)>,
  37. L<PKCS7_verify(3)>, L<PKCS7_encrypt(3)>
  38. L<PKCS7_decrypt(3)>
  39. =head1 COPYRIGHT
  40. Copyright 2002-2016 The OpenSSL Project Authors. All Rights Reserved.
  41. Licensed under the Apache License 2.0 (the "License"). You may not use
  42. this file except in compliance with the License. You can obtain a copy
  43. in the file LICENSE in the source distribution or at
  44. L<https://www.openssl.org/source/license.html>.
  45. =cut