code: def verify_signature(public_key, signature, hash, hash_algo):
      
      hash_algo = _hash_algorithms[hash_algo]
      try:
          return get_publickey(public_key).verify(
              signature,
              hash,
              padding.PKCS1v15(),
              utils.Prehashed(hash_algo),
          ) is None
      except InvalidSignature:
          return False
docs: Verify the given signature is correct for the given hash and public key.
  
      Args:
          public_key (str): PEM encoded public key
          signature (bytes): signature to verify
          hash (bytes): hash of data
          hash_algo (str): hash algorithm used
  
      Returns:
          True if the signature is valid, False otherwise