How can I create a RSA public key in PEM format from an RSA modulus?

谁说我不能喝 提交于 2019-12-07 19:13:43

问题


I have the modulus of an RSA public key. I want to use this public key with the Python library "M2Crypto", but it requires a public key in PEM format.

Thus, I have to convert the RSA modulus to a PEM file.

The modulus can be found here.

Any ideas?


回答1:


The M2Crypto library has a way to reconstruct a public key. You need to know the public exponent, e (often 65337 for RSA keys, but other numbers such as 3 or 17 have been used), and the modulus, n (which is the 512-bit number provided in the question). Note that the docs describe the length-encoded format used for e and n.

Once the public key has been reconstructed, it can be saved into a file and used again later without the hassle of conversion.



来源:https://stackoverflow.com/questions/884207/how-can-i-create-a-rsa-public-key-in-pem-format-from-an-rsa-modulus

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!