Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
wzjjwxy opened this issue Nov 1, 2018 · 3 comments

Comments

@wzjjwxy
Copy link

wzjjwxy commented Nov 1, 2018

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
Copy link

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

@mbaechtold
Copy link
Collaborator

In the traceback I see you are using Python 3. This library is not yet compatible with Python 3. See #40 for more information.

@mbaechtold
Copy link
Collaborator

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants