python and openSSL

Luca Bel lucabel at gmail.com
Thu Sep 10 16:28:34 CEST 2009


I had already installed and tested M2Crypto.
My problem is that with this library I've not found a way to replicate the
operation that I can made with openssl.
As you can see, here:

openssl smime -decrypt -verify -inform DER -in ReadmeDiKe.pdf.p7m -noverify
-out ReadmeDike.pdf

No certificate is used. I can simply extract the contents of p7m and save it
on fs. And the extracted file is perfect.

following this how to, seems that a certificate is always needed, and I
don't have it.

can someone help me?


On Thu, Sep 10, 2009 at 3:56 AM, <exarkun at twistedmatrix.com> wrote:

> On 9 Sep, 01:30 pm, lucabel at gmail.com wrote:
>
>> Hi all.
>> I need a trick to do something like this:
>>
>> openssl smime -decrypt -verify -inform DER -in ReadmeDiKe.pdf.p7m
>> -noverify -out ReadmeDike.pdf
>>
>> To unwrap a p7m file and read his content.
>>
>> I know that I could use somthing like:
>>
>>> import os
>>>>> os.system('openssl ....')
>>>>>
>>>>
>> but i would use a python library to wrap openssl.
>>
>> I've already install pyOpenSSL, but I can not understand how to run the
>> same
>> command.
>>
>
> pyOpenSSL wraps the parts of OpenSSL which deal with S/MIME.  I think that
> M2Crypto does, though I haven't used those parts of it myself.
>
> Jean-Paul
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20090910/7f42fe2c/attachment.html>


More information about the Python-list mailing list