One should only use this method to verify integrity and signatures of a
        RequestMonitoring message.
499229
def verify_request_monitoring(
            self,
            partner_address: Address,
            requesting_address: Address,
    ) -> bool:
        
        if not self.non_closing_signature:
            return False

        balance_proof_data = pack_balance_proof(
            nonce=self.balance_proof.nonce,
            balance_hash=self.balance_proof.balance_hash,
            additional_hash=self.balance_proof.additional_hash,
            canonical_identifier=CanonicalIdentifier(
                chain_identifier=self.balance_proof.chain_id,
                token_network_address=self.balance_proof.token_network_address,
                channel_identifier=self.balance_proof.channel_identifier,
            ),
        )
        blinded_data = pack_balance_proof_update(
            nonce=self.balance_proof.nonce,
            balance_hash=self.balance_proof.balance_hash,
            additional_hash=self.balance_proof.additional_hash,
            canonical_identifier=CanonicalIdentifier(
                chain_identifier=self.balance_proof.chain_id,
                token_network_address=self.balance_proof.token_network_address,
                channel_identifier=self.balance_proof.channel_identifier,
            ),
            partner_signature=self.balance_proof.signature,
        )
        reward_proof_data = pack_reward_proof(
            canonical_identifier=CanonicalIdentifier(
                chain_identifier=self.balance_proof.chain_id,
                token_network_address=self.balance_proof.token_network_address,
                channel_identifier=self.balance_proof.channel_identifier,
            ),
            reward_amount=self.reward_amount,
            nonce=self.balance_proof.nonce,
        )
        return (
            recover(balance_proof_data, self.balance_proof.signature) == partner_address and
            recover(blinded_data, self.non_closing_signature) == requesting_address and
            recover(reward_proof_data, self.reward_proof_signature) == requesting_address
        )
1317163
def check(self, request, consumer, token, signature):
        
        built = self.sign(request, consumer, token)
        if isinstance(signature, STRING_TYPES):
            signature = signature.encode("utf8")
        return built == signature
960363
public boolean verifySignature(byte[] publicKey, byte[] message, byte[] signature) {
    if (publicKey == null || publicKey.length != 32) {
      throw new IllegalArgumentException("Invalid public key!");
    }

    if (message == null || signature == null || signature.length != 64) {
      return false;
    }

    return provider.verifySignature(publicKey, message, signature);
  }
332720
private synchronized boolean needsToThrottle(String signature)
  {
    AtomicInteger sigCount;

    // Are we already throttling this signature?
    if (throttledIncidents.containsKey(signature))
    {
      // Lazily check if it's time to unthrottle
      if (throttledIncidents.get(signature).plusHours(THROTTLE_DURATION_HRS).
          compareTo(DateTime.now()) <= 0)
      {
        // Start counting the # of times we've seen this again & stop throttling.
        throttledIncidents.remove(signature);
        incidentCounter.put(signature, new AtomicInteger(1));
        return false;
      }

      return true;
    }

    sigCount = incidentCounter.get(signature);
    if (sigCount == null)
    {
      // If there isn't an entry to track this signature, make one.
      incidentCounter.put(signature, sigCount = new AtomicInteger(0));
    }
    else if (sigCount.get() + 1 >= INCIDENT_THROTTLE_LIMIT_PER_HR)
    {
      // We've hit the limit so throttle.
      incidentCounter.remove(signature);
      throttledIncidents.put(signature, DateTime.now());
      return true;
    }

    sigCount.incrementAndGet();
    return false;
  }
1310125
public void verify() {
        try {
            performVerification();
        }
        catch (MessagingException e) {
            throw new AssertionError(buildErrorMessage(e.getDescription()), e);
        }
        catch (Throwable e) {
            throw new AssertionError(buildErrorMessage(e.getMessage()), e);
        }
    }
349604
private void audit(JsonSimple response, String oid, String message) {
		JsonObject order = newSubscription(response, oid);
		JsonObject messageObject = (JsonObject) order.get("message");
		messageObject.put("eventType", message);
	}
1352988
function InvalidSignature(reason) {
  Error.captureStackTrace(this, this.constructor);
  this.type = 'unauthorized';
  this.statusCode = 401;
  this.message = 'Invalid request signature';
  this.reason = reason;
}
1300976
void doneWithMeta()
    {
        parsingMeta = false;
        anyToVerify = !sigFileSigners.isEmpty();
        baos = null;
        sigFileData = null;
        pendingBlocks = null;
        signerCache = null;
        manDig = null;
        // MANIFEST.MF is always treated as signed and verified,
        // move its signers from sigFileSigners to verifiedSigners.
        if (sigFileSigners.containsKey(JarFile.MANIFEST_NAME)) {
            verifiedSigners.put(JarFile.MANIFEST_NAME,
                    sigFileSigners.remove(JarFile.MANIFEST_NAME));
        }
    }
1261209
protected final void validateAssertionSignature(final Signature signature, final SAML2MessageContext context,
                                                    final SignatureTrustEngine engine) {

        final SAMLPeerEntityContext peerContext = context.getSAMLPeerEntityContext();

        if (signature != null) {
            final String entityId = peerContext.getEntityId();
            validateSignature(signature, entityId, engine);
        } else {
            if (wantsAssertionsSigned(context) && !peerContext.isAuthenticated()) {
                throw new SAMLSignatureRequiredException("Assertion or response must be signed");
            }
        }
    }
1087687
private boolean verifyHelloMessage(byte[] helloMsg) {
		if (sdpHelloHashReceived != null) {
			String hash = calculateSHA256Hash(helloMsg, 0, helloMsg.length);
			boolean hashesMatched = hash.toUpperCase().equals(
					sdpHelloHashReceived.toUpperCase());
			if (platform.getLogger().isEnabled()) {
				if (hashesMatched) {
					logString("verifyHelloMessage() Hello hash verified OK.");
				} else {
					logString("verifyHelloMessage() Hello hash does NOT match  hash= '"
							+ hash
							+ "' expected (SDP) = '"
							+ sdpHelloHashReceived + "'");
				}
			}
			return hashesMatched;
		} else {
			return true;
		}
	}
1232243
def Verify(self, message, signature, hash_algorithm=None):
    """"""
    # This method accepts both PSS and PKCS1v15 padding. PSS is preferred but
    # old clients only support PKCS1v15.

    if hash_algorithm is None:
      hash_algorithm = hashes.SHA256()

    last_e = None
    for padding_algorithm in [
        padding.PSS(
            mgf=padding.MGF1(hash_algorithm),
            salt_length=padding.PSS.MAX_LENGTH),
        padding.PKCS1v15()
    ]:
      try:
        self._value.verify(signature, message, padding_algorithm,
                           hash_algorithm)
        return True

      except exceptions.InvalidSignature as e:
        last_e = e

    raise VerificationError(last_e)
518440
def verifymessage(self, address, signature, message):
        """"""
        return self.req("verifymessage", [address, signature, message])
282279
public static boolean verify(
      Signature signatureAlgorithm, PublicKey publicKey, byte[] signatureBytes, byte[] contentBytes)
      throws InvalidKeyException, SignatureException {
    signatureAlgorithm.initVerify(publicKey);
    signatureAlgorithm.update(contentBytes);
    // SignatureException may be thrown if we are tring the wrong key.
    try {
      return signatureAlgorithm.verify(signatureBytes);
    } catch (SignatureException e) {
      return false;
    }
  }
680671
protected final void validateAssertion(final Assertion assertion, final SAML2MessageContext context,
                                           final SignatureTrustEngine engine, final Decrypter decrypter) {

        validateIssueInstant(assertion.getIssueInstant());

        validateIssuer(assertion.getIssuer(), context);

        if (assertion.getSubject() != null) {
            validateSubject(assertion.getSubject(), context, decrypter);
        } else {
            throw new SAMAssertionSubjectException("Assertion subject cannot be null");
        }

        validateAssertionConditions(assertion.getConditions(), context);

        validateAuthenticationStatements(assertion.getAuthnStatements(), context);

        validateAssertionSignature(assertion.getSignature(), context, engine);

    }
1307135
def verify_signature(self, signature, nonce, timestamp, signed_id):
        
        message = "%s%s%s%s" % (self.api_key, nonce, timestamp, signed_id)

        if self._pub_key is None:
            warnings.warn("Skipping RSA signature verification. Please pass public key on class initialization to ensure highest level of security!")
            return True

        try:
            rsa.verify(message.encode('utf-8'), signature, self._pub_key)
        except rsa.VerificationError:
            return False

        return True
710443
public void verifyStatus() {
    if (sequential) {
      boolean unopenedIterator = responseIterator == null && !responses.isEmpty();
      if (unopenedIterator || responseIterator.hasNext()) {
        throw new VerificationAssertionError("More executions were expected");
      }
    }
  }
192272
public static boolean verify(byte[] data, byte[] signature, byte[] pub) {
        return verify(data, ECDSASignature.decodeFromDER(signature), pub);
    }