diff --git a/pkcs7/README.md b/pkcs7/README.md index 01311f3e..71ffac25 100644 --- a/pkcs7/README.md +++ b/pkcs7/README.md @@ -618,6 +618,26 @@ Q31HIqX6H6JYdgtwHB1ZHaq+XS0lfLEGtsCqKKqTfNC9Q62RUBx7TfPk1w== -----END CERTIFICATE----- ``` +### Creating an SMIME bundle and verifying it + +In these example cases the content will be overridden by the content found in the +SMIME bundle. The smime application creates both a detatched +(detatched-smime-created.p7s) and a non detatched bundle (smime-created.p7s). + +Creating RSA signed bundles: + +``` +./smime ../certs/client-key.der ../certs/client-cert.der +./smime-verify smime-created.p7s ../certs/client-cert.der content.txt +``` + +Creating ECC signed bundles: + +``` +./smime ../certs/ecc-client-key.der ../certs/client-ecc-cert.der +./smime-verify detached-smime-created.p7s ../certs/client-ecc-cert.der content.txt +``` + ## Support Please email wolfSSL support at support@wolfssl.com with any questions about diff --git a/pkcs7/smime.c b/pkcs7/smime.c index b9730b64..376ae6f0 100644 --- a/pkcs7/smime.c +++ b/pkcs7/smime.c @@ -193,6 +193,10 @@ int main(int argc, char** argv) return -1; } +#ifdef DEBUG_WOLFSSL + wolfSSL_Debugging_ON(); +#endif + if (wolfSSL_Init() != WOLFSSL_SUCCESS) { printf("Failure to initialize wolfSSL library\n"); return -1; @@ -218,7 +222,7 @@ int main(int argc, char** argv) /* create detached pkcs7 smime bundle */ printf("\n"); - smimeSz = 3072; + smimeSz = sizeof(smime); memset(smime, 0, smimeSz); if (ret == 0) ret = Create(smime, &smimeSz, key, keySz, cert, certSz,