diff options
Diffstat (limited to 'src/lib/libcrypto/doc/SMIME_read_PKCS7.pod')
| -rw-r--r-- | src/lib/libcrypto/doc/SMIME_read_PKCS7.pod | 71 |
1 files changed, 71 insertions, 0 deletions
diff --git a/src/lib/libcrypto/doc/SMIME_read_PKCS7.pod b/src/lib/libcrypto/doc/SMIME_read_PKCS7.pod new file mode 100644 index 0000000000..ffafa37887 --- /dev/null +++ b/src/lib/libcrypto/doc/SMIME_read_PKCS7.pod | |||
| @@ -0,0 +1,71 @@ | |||
| 1 | =pod | ||
| 2 | |||
| 3 | =head1 NAME | ||
| 4 | |||
| 5 | SMIME_read_PKCS7 - parse S/MIME message. | ||
| 6 | |||
| 7 | =head1 SYNOPSIS | ||
| 8 | |||
| 9 | PKCS7 *SMIME_read_PKCS7(BIO *in, BIO **bcont); | ||
| 10 | |||
| 11 | =head1 DESCRIPTION | ||
| 12 | |||
| 13 | SMIME_read_PKCS7() parses a message in S/MIME format. | ||
| 14 | |||
| 15 | B<in> is a BIO to read the message from. | ||
| 16 | |||
| 17 | If cleartext signing is used then the content is saved in | ||
| 18 | a memory bio which is written to B<*bcont>, otherwise | ||
| 19 | B<*bcont> is set to B<NULL>. | ||
| 20 | |||
| 21 | The parsed PKCS#7 structure is returned or B<NULL> if an | ||
| 22 | error occurred. | ||
| 23 | |||
| 24 | =head1 NOTES | ||
| 25 | |||
| 26 | If B<*bcont> is not B<NULL> then the message is clear text | ||
| 27 | signed. B<*bcont> can then be passed to PKCS7_verify() with | ||
| 28 | the B<PKCS7_DETACHED> flag set. | ||
| 29 | |||
| 30 | Otherwise the type of the returned structure can be determined | ||
| 31 | using PKCS7_type(). | ||
| 32 | |||
| 33 | To support future functionality if B<bcont> is not B<NULL> | ||
| 34 | B<*bcont> should be initialized to B<NULL>. For example: | ||
| 35 | |||
| 36 | BIO *cont = NULL; | ||
| 37 | PKCS7 *p7; | ||
| 38 | |||
| 39 | p7 = SMIME_read_PKCS7(in, &cont); | ||
| 40 | |||
| 41 | =head1 BUGS | ||
| 42 | |||
| 43 | The MIME parser used by SMIME_read_PKCS7() is somewhat primitive. | ||
| 44 | While it will handle most S/MIME messages more complex compound | ||
| 45 | formats may not work. | ||
| 46 | |||
| 47 | The parser assumes that the PKCS7 structure is always base64 | ||
| 48 | encoded and will not handle the case where it is in binary format | ||
| 49 | or uses quoted printable format. | ||
| 50 | |||
| 51 | The use of a memory BIO to hold the signed content limits the size | ||
| 52 | of message which can be processed due to memory restraints: a | ||
| 53 | streaming single pass option should be available. | ||
| 54 | |||
| 55 | =head1 RETURN VALUES | ||
| 56 | |||
| 57 | SMIME_read_PKCS7() returns a valid B<PKCS7> structure or B<NULL> | ||
| 58 | is an error occurred. The error can be obtained from ERR_get_error(3). | ||
| 59 | |||
| 60 | =head1 SEE ALSO | ||
| 61 | |||
| 62 | L<ERR_get_error(3)|ERR_get_error(3)>, L<PKCS7_type(3)|PKCS7_type(3)> | ||
| 63 | L<SMIME_read_PKCS7(3)|SMIME_read_PKCS7(3)>, L<PKCS7_sign(3)|PKCS7_sign(3)>, | ||
| 64 | L<PKCS7_verify(3)|PKCS7_verify(3)>, L<PKCS7_encrypt(3)|PKCS7_encrypt(3)> | ||
| 65 | L<PKCS7_decrypt(3)|PKCS7_decrypt(3)> | ||
| 66 | |||
| 67 | =head1 HISTORY | ||
| 68 | |||
| 69 | SMIME_read_PKCS7() was added to OpenSSL 0.9.5 | ||
| 70 | |||
| 71 | =cut | ||
