Hello Steve,

Thanks for your clear answer.

Regards,
Thomas.






Re: Delete (not display) header after decryption of p7m file.

(Internet)
steve 


A :
openssl-users

04/01/2014 03:29

Envoyé par: owner-openssl-us...@openssl.org
Veuillez répondre à openssl-users






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



This message and any attachments (the "message") is
intended solely for the intended addressees and is confidential. 
If you receive this message in error,or are not the intended recipient(s), 
please delete it and any copies from your systems and immediately notify
the sender. Any unauthorized view, use that does not comply with its purpose, 
dissemination or disclosure, either whole or partial, is prohibited. Since the 
internet 
cannot guarantee the integrity of this message which may not be reliable, BNP 
PARIBAS 
(and its subsidiaries) shall not be liable for the message if modified, changed 
or falsified. 
Do not print this message unless it is necessary,consider the environment.

----------------------------------------------------------------------------------------------------------------------------------

Ce message et toutes les pieces jointes (ci-apres le "message") 
sont etablis a l'intention exclusive de ses destinataires et sont confidentiels.
Si vous recevez ce message par erreur ou s'il ne vous est pas destine,
merci de le detruire ainsi que toute copie de votre systeme et d'en avertir
immediatement l'expediteur. Toute lecture non autorisee, toute utilisation de 
ce message qui n'est pas conforme a sa destination, toute diffusion ou toute 
publication, totale ou partielle, est interdite. L'Internet ne permettant pas 
d'assurer
l'integrite de ce message electronique susceptible d'alteration, BNP Paribas 
(et ses filiales) decline(nt) toute responsabilite au titre de ce message dans 
l'hypothese
ou il aurait ete modifie, deforme ou falsifie. 
N'imprimez ce message que si necessaire, pensez a l'environnement.

Reply via email to