def VerifyDataSignedWithCert(self, data, signature, cert=None):
    """Verify that this cert signed this data.

    Args:
      data: str, data to verify signing
      signature: str, signature data
      cert: certificate object, or None for this instance's cert
    Returns:
      True or False
    Raises:
      CryptoError: if the underlying crypto APIs raise an assertion due to
        malformed data
    """
    if cert is None:
      cert = self._cert

    signature_b = array.array('B')
    signature_b.fromstring(str(signature))

    data_b = array.array('B')
    data_b.fromstring(str(data))

    try:
      pk = cert.GetPublicKey()
      return pk.hashAndVerify(signature_b, data_b)
    except __HOLE__, e:
      logging.exception(str(e))
      raise CryptoError(
          'VerifyDataSignedWithCert: hashAndVerify: %s' % str(e))
dataset/ETHPy150Open google/simian/src/simian/auth/base.py/Auth1.VerifyDataSignedWithCert