У меня есть эта надоедливая ошибка M2Crypto:
Traceback (most recent call last): File
"/Work/pythonWork/pkpass/test.py", line 18, in <module>
smime.load_key(str(keypemPath), pemPath,callback=passwordCallback) 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.
Мой код:
def passwordCallback():
return "123456"
smime = SMIME.SMIME()
wwdrcert = X509.load_cert(wwdrpemPath)
stack = X509_Stack()
stack.push(wwdrcert)
smime.set_x509_stack(stack)
smime.load_key(str(keypemPath), pemPath,callback=passwordCallback)
- Моя версия Python: 3.6
- Моя версия openssl: OpenSSL 1.0.2p
- Моя версия M2Crypto: 0.30.1