I generated an RSA public and private key pair using the pycryptodome
module and returned the private key to the user. Now, for fetching some specific data, I need to validate the public and private key pair. I have both of them in bytes
form:
public_key = b'-----BEGIN PUBLIC KEY-----\nMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAlisb129W98LyU3caYcTr\nowqPJLUuaP9imnAOcJxzrKgK..........................qGUPMhPxVFA92mifqr9T2m5cI5/b\nCwIDAQAB\n-----END PUBLIC KEY-----'
private_key = bytes(input())
I need to create a function to check whether the private key entered by the user matches the public key stored by the program.