[PYTHON-CRYPTO] How to get exponent from a PKey object?

flya flya flyaflyaa at GMAIL.COM
Fri Feb 27 13:37:26 CET 2009


I need read the public key from  certificate, I can get a PKey object
use follow codes:
    from M2Crypto import X509
    cer = X509.load_cert('test.pem', X509.FORMAT_PEM)
    pk = cer.get_pubkey()
and use pk.get_modulus() to get the modulus, but how can I get exponent?
I need these  two values to make a new public key struct , and use it
as a param to call a function from a dll file using ctypes. I found E
is often 65537, but I ask a university teacher, he say it can be any
value, so how can I get it?



More information about the python-crypto mailing list