SMIME_read_ASN1.pod 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. =pod
  2. =head1 NAME
  3. SMIME_read_ASN1_ex, SMIME_read_ASN1
  4. - parse S/MIME message
  5. =head1 SYNOPSIS
  6. #include <openssl/asn1.h>
  7. ASN1_VALUE *SMIME_read_ASN1_ex(BIO *in, BIO **bcont, const ASN1_ITEM *it,
  8. ASN1_VALUE **x);
  9. ASN1_VALUE *SMIME_read_ASN1(BIO *in, BIO **bcont, const ASN1_ITEM *it);
  10. =head1 DESCRIPTION
  11. SMIME_read_ASN1_ex() parses a message in S/MIME format.
  12. I<in> is a BIO to read the message from. I<x> can be used to optionally supply
  13. a previously created I<it> ASN1_VALUE object (such as CMS_ContentInfo or PKCS7),
  14. it can be set to NULL. Valid values that can be used by ASN.1 structure I<it>
  15. are ASN1_ITEM_rptr(PKCS7) or ASN1_ITEM_rptr(CMS_ContentInfo).
  16. If cleartext signing is used then the content is saved in a memory bio which is
  17. written to I<*bcont>, otherwise I<*bcont> is set to NULL.
  18. The parsed ASN1_VALUE structure is returned or NULL if an error occurred.
  19. SMIME_read_ASN1() is similar to SMIME_read_ASN1_ex() but sets the value of I<x>
  20. to NULL.
  21. =head1 NOTES
  22. The higher level functions L<SMIME_read_CMS_ex(3)> and
  23. L<SMIME_read_PKCS7_ex(3)> should be used instead of SMIME_read_ASN1_ex().
  24. To support future functionality if I<bcont> is not NULL I<*bcont> should be
  25. initialized to NULL.
  26. =head1 BUGS
  27. The MIME parser used by SMIME_read_ASN1_ex() is somewhat primitive. While it will
  28. handle most S/MIME messages more complex compound formats may not work.
  29. The use of a memory BIO to hold the signed content limits the size of message
  30. which can be processed due to memory restraints: a streaming single pass option
  31. should be available.
  32. =head1 RETURN VALUES
  33. SMIME_read_ASN1_ex() and SMIME_read_ASN1() return a valid B<ASN1_VALUE>
  34. structure or B<NULL> if an error occurred. The error can be obtained from
  35. ERR_get_error(3).
  36. =head1 SEE ALSO
  37. L<ERR_get_error(3)>,
  38. L<SMIME_read_CMS_ex(3)>,
  39. L<SMIME_read_PKCS7_ex(3)>,
  40. L<SMIME_write_ASN1(3)>,
  41. L<SMIME_write_ASN1_ex(3)>
  42. =head1 HISTORY
  43. The function SMIME_read_ASN1_ex() was added in OpenSSL 3.0.
  44. =head1 COPYRIGHT
  45. Copyright 2020 The OpenSSL Project Authors. All Rights Reserved.
  46. Licensed under the Apache License 2.0 (the "License"). You may not use
  47. this file except in compliance with the License. You can obtain a copy
  48. in the file LICENSE in the source distribution or at
  49. L<https://www.openssl.org/source/license.html>.
  50. =cut