SMIME_write_PKCS7.pod 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  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 B<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 constructuted 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)|ERR_get_error(3)>, L<PKCS7_sign(3)|PKCS7_sign(3)>,
  37. L<PKCS7_verify(3)|PKCS7_verify(3)>, L<PKCS7_encrypt(3)|PKCS7_encrypt(3)>
  38. L<PKCS7_decrypt(3)|PKCS7_decrypt(3)>
  39. =head1 HISTORY
  40. SMIME_write_PKCS7() was added to OpenSSL 0.9.5
  41. =cut