from Crypto.PublicKey import RSA
with open("privacy_enhanced_mail.pem", "r") as f:
key = RSA.import_key(f.read())
print(key.d)
openssl x509 -in 2048b-rsa-example-cert.der -inform DER -out 2048b-rsa-example-cert.pem -outform PEM
from Crypto.PublicKey import RSA
with open("2048b-rsa-example-cert.pem", "r") as f:
key = RSA.import_key(f.read())
print(key.n)
from Crypto.PublicKey import RSA
with open("bruce_rsa.pub", "r") as f:
key = RSA.import_key(f.read())
print(key.n)