2
0

BIO_new_CMS.pod 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. =pod
  2. =head1 NAME
  3. BIO_new_CMS - CMS streaming filter BIO
  4. =head1 SYNOPSIS
  5. #include <openssl/cms.h>
  6. BIO *BIO_new_CMS(BIO *out, CMS_ContentInfo *cms);
  7. =head1 DESCRIPTION
  8. BIO_new_CMS() returns a streaming filter BIO chain based on B<cms>. The output
  9. of the filter is written to B<out>. Any data written to the chain is
  10. automatically translated to a BER format CMS structure of the appropriate type.
  11. =head1 NOTES
  12. The chain returned by this function behaves like a standard filter BIO. It
  13. supports non blocking I/O. Content is processed and streamed on the fly and not
  14. all held in memory at once: so it is possible to encode very large structures.
  15. After all content has been written through the chain BIO_flush() must be called
  16. to finalise the structure.
  17. The B<CMS_STREAM> flag must be included in the corresponding B<flags>
  18. parameter of the B<cms> creation function.
  19. If an application wishes to write additional data to B<out> BIOs should be
  20. removed from the chain using BIO_pop() and freed with BIO_free() until B<out>
  21. is reached. If no additional data needs to be written BIO_free_all() can be
  22. called to free up the whole chain.
  23. Any content written through the filter is used verbatim: no canonical
  24. translation is performed.
  25. It is possible to chain multiple BIOs to, for example, create a triple wrapped
  26. signed, enveloped, signed structure. In this case it is the applications
  27. responsibility to set the inner content type of any outer CMS_ContentInfo
  28. structures.
  29. Large numbers of small writes through the chain should be avoided as this will
  30. produce an output consisting of lots of OCTET STRING structures. Prepending
  31. a BIO_f_buffer() buffering BIO will prevent this.
  32. =head1 BUGS
  33. There is currently no corresponding inverse BIO: i.e. one which can decode
  34. a CMS structure on the fly.
  35. =head1 RETURN VALUES
  36. BIO_new_CMS() returns a BIO chain when successful or NULL if an error
  37. occurred. The error can be obtained from ERR_get_error(3).
  38. =head1 SEE ALSO
  39. L<ERR_get_error(3)>, L<CMS_sign(3)>,
  40. L<CMS_encrypt(3)>
  41. =head1 HISTORY
  42. The BIO_new_CMS() function was added in OpenSSL 1.0.0.
  43. =head1 COPYRIGHT
  44. Copyright 2008-2016 The OpenSSL Project Authors. All Rights Reserved.
  45. Licensed under the Apache License 2.0 (the "License"). You may not use
  46. this file except in compliance with the License. You can obtain a copy
  47. in the file LICENSE in the source distribution or at
  48. L<https://www.openssl.org/source/license.html>.
  49. =cut