How to load an RSA key from a PEM file and use it in python-crypto

前端 未结 2 1812
臣服心动
臣服心动 2020-12-10 03:51

I have not found a way to load an RSA private key from a PEM file to use it in python-crypto (signature).

python-openssl can load a PEM file but the PKey object can\

2条回答
  •  眼角桃花
    2020-12-10 04:48

    is this (close to) what you tried doing?

    public_key_filename = 'public_key.pem'
    rsa = M2Crypto.RSA.load_pub_key(pk)
    

    That should work. The issue might be with openssl too, does it work when you just use openssl (not in Python)?

    Link to Me Too Crypto

提交回复
热议问题