1 /* Simple S/MIME uncompression example */
2 #include <openssl/pem.h>
3 #include <openssl/cms.h>
4 #include <openssl/err.h>
6 int main(int argc
, char **argv
)
8 BIO
*in
= NULL
, *out
= NULL
;
9 CMS_ContentInfo
*cms
= NULL
;
12 OpenSSL_add_all_algorithms();
13 ERR_load_crypto_strings();
15 /* Open compressed content */
17 in
= BIO_new_file("smcomp.txt", "r");
23 cms
= SMIME_read_CMS(in
, NULL
);
28 out
= BIO_new_file("smuncomp.txt", "w");
32 /* Uncompress S/MIME message */
33 if (!CMS_uncompress(cms
, out
, NULL
, 0))
41 fprintf(stderr
, "Error Uncompressing Data\n");
42 ERR_print_errors_fp(stderr
);
46 CMS_ContentInfo_free(cms
);