On Fri, Jan 03, 2014, thomas.lall...@externe.bnpparibas.com wrote:

> Hello and happy new year !
> 
> I have a problem with header of a p7m file after decryption.
> 
> Indeed, I would like to delete (not display) the header after decryption. 
> So, with content-type "plain/text", there is no problem due to the "-text" 
> option like that :
> 
> - Without "-text" option - #openssl smime -decrypt -inform DER -in 
> <file>.p7m -out <file>.txt -recip <certificate>.pem -inkey 
> <privatekey>.key :
> 
> Content-Type: text/plain;
>  name="TestCSV.txt"
> Content-Transfer-Encoding: binary
> Content-Disposition: attachment;
>  filename="TestCSV.txt"
> 
> Test
> 
> - With "-text" option - #openssl smime -decrypt -inform DER -in <file>.p7m 
> -out <file>.txt -recip <certificate>.pem -inkey <privatekey>.key -text :
> 
> Test
> 
> But, if I want to delete the header for other content-type (Excel document 
> for exemple : 
> application/vnd.openxmlformats-officedocument.spreadsheetml.sheet) it's 
> not possible to use "-text" option.
> 
> So, how is it possible to have the same result (without header) for 
> non-plain/text file with OpenSSL command ?
> 
> For the moment, I can just use a diversion with "sed" that allows me to 
> delete the header after decryption. But, I know it's not the best 
> solution.
> 

There is no option to do that. The MIME parser for the smime (and cms)
commands is very primitive and only intended for simple messages. If you need
more complex behaviour you need to perform the MIME parsing yourself.

Steve.
--
Dr Stephen N. Henson. OpenSSL project core developer.
Commercial tech support now available see: http://www.openssl.org
______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
User Support Mailing List                    openssl-users@openssl.org
Automated List Manager                           majord...@openssl.org

Reply via email to