KB Article #179499

How to encode S/MIME in DER (binary) format and not in PEM

Problem


With CFTTF, the default encoding for S/MIME is "Content-Transfer-Encoding: base64".
The header of the output file encrypted and signed is like below:

Content-Type: application/pkcs7-mime; smime-type=enveloped-data; name=smime.p7m
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename=smime.p7m


How to encode S/MIME in DER (binary) format and not in PEM.



Resolution

S/MIME encoding result is always base64 encoded.


The binary encoding is the same as for CMS, but the base64 envelope and S/MIME headers are added when using S/MIME as security standard.



To obtain a DER encoding, you must use CMS as security standard.