code: def key_verify(rsakey, signature, message, digest):
      
      padding = _asymmetric.padding.PKCS1v15()
      if isinstance(rsakey, _asymmetric.rsa.RSAPrivateKey):
          rsakey = rsakey.public_key()
  
      try:
          rsakey.verify(signature, message, padding, digest)
      except Exception as e:
          return False
      else:
          return True
docs: Verify the given signature with the RSA key.