[pycrypto] How can I read a standard openssl private key with PyCrypto and decrypt with it?

William Heath wgheath at gmail.com
Tue Aug 18 19:07:53 CST 2009


Hi All,


I generated a private key with:


openssl.exe req -x509 -nodes -days 365 -newkey rsa:1024 -keyout
sdgidfedapp11.corp.intuit.net.key -out sdgidfedapp11.corp.intuit.net.crt


I can't figure out is how to use PyCrypto.RSA.construct with it

to decrypt something.  This works however:


from M2Crypto import RSA


priv_key = RSA.load_key('private.key', get_password)


decrypted_key = priv_key.private_decrypt(base64.b64decode(enc_key),
RSA.pkcs1

_padding)


I am sure there is a way to do this with PyCrypto, anyone know how to do it?


-Tim


P.S.


Thanks for this awsome library, especially on google appe engine!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.dlitz.net/pipermail/pycrypto/attachments/20090818/8fdcf767/attachment.htm 


More information about the pycrypto mailing list