devartis / passbook

Python library to create Apple Passbook (.pkpass) files
http://www.devartis.com/
MIT License
272 stars 107 forks source link

M2Crypto.EVP.EVPError: Unable to read private key in function pkey_read_pem. #47

Open wzjjwxy opened 5 years ago

wzjjwxy commented 5 years ago

Hi~ I have a problem with smime exceptions when reading pem files (smime.load_key(str(keyPemPath), certificatePemPath)), exception information: M2Crypto.EVP.EVPError: Unable to read private key in function pkey_read_pem. Complete error: Traceback (most recent call last):    File "/Work/pythonWork/pkpass/test.py", line 15, in      Smime.load_key(str(keypemPath), pemPath)    File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/M2Crypto/SMIME.py", line 163, in load_key      Self.pkey = EVP.load_key(keyfile, callback)    File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/M2Crypto/EVP.py", line 395, in load_key      Cptr = m2.pkey_read_pem(bio.bio, callback) M2Crypto.EVP.EVPError: Unable to read private key in function pkey_read_pem.

winhtaikaung commented 5 years ago

Hi @wzjjwxy Is there any updates or work around on that issue ? I am also facing that issue. Any help would be appreciated

mbaechtold commented 5 years ago

In the traceback I see you are using Python 3. This library is not yet compatible with Python 3. See https://github.com/devartis/passbook/issues/40 for more information.

mbaechtold commented 4 years ago

Support for Python 3 has landed in the master branch. You could give it a try by installing it from GitHub.