From scott_list at mischko.com Thu Aug 18 23:30:18 2005 From: scott_list at mischko.com (Scott Chapman) Date: Thu, 18 Aug 2005 14:30:18 -0700 Subject: [pyOpenSSL] Can I use pyOpenSSL to dynamically encrypt PayPal buttons? Message-ID: <4304FDEA.4050309@mischko.com> I need to dynamically encrypt buttons for my web site's interaction with PayPal, similar to this example of how to do it from the shell prompt using OpenSSL: http://paypaltech.com/Dave/api_sourcebook/html/ewp/ewpshell.html 1) Will pyOpenSSL do this? 2) Any pointers on where to start/how to do this with pyOpenSSL would be very helpful. I'm new to encryption. I can generate the certificates Ok so far (using OpenSSL at the command line, not Python :( ). I don't find any examples on how to use pyOpenSSL in the docs, just a bare rundown on the objects. Did I miss something? I'm rather lost here trying to figure out what all to use. Thanks! Scott From spe.stani.be at gmail.com Tue Aug 23 03:14:56 2005 From: spe.stani.be at gmail.com (SPE - Stani's Python Editor) Date: Tue, 23 Aug 2005 03:14:56 +0200 Subject: [pyOpenSSL] help: invalid universalstring length Message-ID: <430A7890.2040107@gmail.com> Hi, I need to use OpenSSL for Webcleaner, a python proxy filter. However there seems to be this error. The author of Webcleaner cannot reproduce this bug. So for me it is really a mistery. Does anybody understands what goes wrong and what could be a solution or to point me in a direction. I use the latest version of openssl (Win32OpenSSL-v0.9.8.exe) on windows xp professional and home edition, both dutch. Could the dutch be a problem? I also use pyOpenSSL-0.6.win32-py2.4.exe for the bindings, provided on the homepage of Webcleaner. Traceback (most recent call last): File "C:\Python24\Scripts\webcleaner-certificates", line 113, in ? main(sys.argv[1:]) File "C:\Python24\Scripts\webcleaner-certificates", line 105, in main install_ssl_certs(configdir) File "C:\Python24\Scripts\webcleaner-certificates", line 61, in install_ssl_certs wc.proxy.ssl.create_certificates(configdir) File "C:\Python24\Lib\site-packages\wc\proxy\ssl.py", line 109, in create_certificates careq = createCertRequest(cakey, CN='Certificate Authority') File "C:\Python24\Lib\site-packages\wc\proxy\ssl.py", line 179, in createCertRequest setattr(subj, key, value) OpenSSL.crypto.Error: [('asn1 encoding routines', 'ASN1_mbstring_ncopy', 'invalid universalstring length')] Please help, as I am quite desperate to get this working! Thanks, Stani From scott_list at mischko.com Tue Aug 23 11:07:29 2005 From: scott_list at mischko.com (Scott Chapman) Date: Tue, 23 Aug 2005 02:07:29 -0700 Subject: [pyOpenSSL] Re: Can I use pyOpenSSL to dynamically encrypt PayPal buttons? In-Reply-To: <4304FDEA.4050309@mischko.com> References: <4304FDEA.4050309@mischko.com> Message-ID: <430AE751.5050104@mischko.com> Scott Chapman wrote: > I need to dynamically encrypt buttons for my web site's interaction with > PayPal, similar to this example of how to do it from the shell prompt > using OpenSSL: > http://paypaltech.com/Dave/api_sourcebook/html/ewp/ewpshell.html > > 1) Will pyOpenSSL do this? > > 2) Any pointers on where to start/how to do this with pyOpenSSL would be > very helpful. I'm new to encryption. I can generate the certificates > Ok so far (using OpenSSL at the command line, not Python :( ). I don't > find any examples on how to use pyOpenSSL in the docs, just a bare > rundown on the objects. Did I miss something? I'm rather lost here > trying to figure out what all to use. More specifically, I need to emulate this openssl command: openssl smime -sign -in $tempfile -signer $MY_CERT -inkey $MY_KEY -outform der -nodetach -binary | \ openssl smime -encrypt -des3 -binary -outform pem /root/sandbox_cert_key_pem.txt I am completely at a loss to deal with the pyOpenSSL library and really need a lift here if anyone can help me out. TIA, Scott From scott_list at mischko.com Tue Aug 23 20:15:20 2005 From: scott_list at mischko.com (Scott Chapman) Date: Tue, 23 Aug 2005 11:15:20 -0700 Subject: [pyOpenSSL] Re: Can I use pyOpenSSL to dynamically encrypt PayPal buttons? In-Reply-To: <4304FDEA.4050309@mischko.com> References: <4304FDEA.4050309@mischko.com> Message-ID: <430B67B8.8010702@mischko.com> Scott Chapman wrote: > I need to dynamically encrypt buttons for my web site's interaction with > PayPal, similar to this example of how to do it from the shell prompt > using OpenSSL: > http://paypaltech.com/Dave/api_sourcebook/html/ewp/ewpshell.html > > 1) Will pyOpenSSL do this? > > 2) Any pointers on where to start/how to do this with pyOpenSSL would be > very helpful. I'm new to encryption. I can generate the certificates > Ok so far (using OpenSSL at the command line, not Python :( ). I don't > find any examples on how to use pyOpenSSL in the docs, just a bare > rundown on the objects. Did I miss something? I'm rather lost here > trying to figure out what all to use. More specifically, I need to emulate this openssl command: openssl smime -sign -in $tempfile -signer $MY_CERT -inkey $MY_KEY -outform der -nodetach -binary | \ openssl smime -encrypt -des3 -binary -outform pem /root/sandbox_cert_key_pem.txt I am completely at a loss to deal with the pyOpenSSL library and really need a lift here if anyone can help me out. TIA, Scott From scott_list at mischko.com Fri Aug 26 22:37:42 2005 From: scott_list at mischko.com (Scott Chapman) Date: Fri, 26 Aug 2005 13:37:42 -0700 Subject: [pyOpenSSL] Can someone help me get this openssl command into pyOpenSSL? Message-ID: <430F7D96.8050804@mischko.com> openssl smime -sign -in $tempfile -signer $MY_CERT -inkey $MY_KEY -outform der -nodetach -binary | \ openssl smime -encrypt -des3 -binary -outform pem paypal_public_cert_sandbox.pem I'm not making progress on the pyOpenSSL module and so I'm trying to use subprocess to run this which is not the most elegant way. Can anyone give me the right code in Python to do this? TIA, Scott