x509

Extract a public key from certificate

Extract a public key from certificate Question: I’m trying to extract a public key from my certificate but i keep getting this error: ValueError: RSA key format is not supported.. Below is my code: from Crypto.PublicKey import RSA bob_crt = ‘bob.crt’ public_key = RSA.import_key(bob_crt) if isinstance(public_key, RSA.RsaKey): print("RSA public key") else: print("Other key") —–BEGIN CERTIFICATE—– …

Total answers: 1

How to read a RSA public key in PEM + PKCS#1 format

How to read a RSA public key in PEM + PKCS#1 format Question: I have a RSA public key in PEM format + PKCS#1(I guess): —–BEGIN RSA PUBLIC KEY—– MIGJAoGBAJNrHWRFgWLqgzSmLBq2G89exgi/Jk1NWhbFB9gHc9MLORmP3BOCJS9k onzT/+Dk1hdZf00JGgZeuJGoXK9PX3CIKQKRQRHpi5e1vmOCrmHN5VMOxGO4d+zn JDEbNHODZR4HzsSdpQ9SGMSx7raJJedEIbr0IP6DgnWgiA7R1mUdAgMBAAE= —–END RSA PUBLIC KEY—– I want to get the SHA1 digest of its ASN1 encoded version in Python. The first step should be …

Total answers: 1