This is for a homework assignment!
I get the server's certificate using get_peer_certificate()
and the calling dump_certificate
to dump the certificate in a variable. The format is PEM and looks right to me.
-----BEGIN CERTIFICATE-----
GIBBERISH................
......................
........................
-----END CERTIFICATE-----
How do I extract the server's public key from this file ('server.pubkey') and encrypt plaintext
using RSA
algorithm and any python library. At the time of writing this, I am using pyOpenSSL
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…