This includes legacy signatures. Might include false positives.
971050
public static boolean seemsToHaveSignature(Nanopub nanopub) {
		for (Statement st : nanopub.getPubinfo()) {
			if (st.getPredicate().equals(NanopubSignatureElement.HAS_SIGNATURE_ELEMENT)) return true;
			if (st.getPredicate().equals(NanopubSignatureElement.HAS_SIGNATURE_TARGET)) return true;
			if (st.getPredicate().equals(NanopubSignatureElement.HAS_SIGNATURE)) return true;
			if (st.getPredicate().equals(CryptoElement.HAS_PUBLIC_KEY)) return true;
		}
		return false;
	}
276946
private static boolean Verify(InputStream isSignature, InputStream isMessage, InputStream isPublicKey) throws LRException
    {
		// Get the public key ring collection from the public key input stream
		PGPPublicKeyRingCollection pgpRings = null;
		
		try
		{
			 pgpRings = new PGPPublicKeyRingCollection(PGPUtil.getDecoderStream(isPublicKey));
		}
		catch (Exception e)
		{
			throw new LRException(LRException.INVALID_PUBLIC_KEY);
		}
	
		// Add the Bouncy Castle security provider
		Security.addProvider(new BouncyCastleProvider());
		
		// Build an output stream from the message for verification
		boolean verify = false;
		int ch;
		ByteArrayOutputStream bOut = new ByteArrayOutputStream();
		ArmoredInputStream aIn  = null;
		
		try
		{
			aIn = new ArmoredInputStream(isMessage);
			// We are making no effort to clean the input for this example
			// If this turns into a fully-featured verification utility in a future version, this will need to be handled
			while ((ch = aIn.read()) >= 0 && aIn.isClearText())
			{
				bOut.write((byte)ch);
			}
			
			bOut.close();
		}
		catch (Exception e)
		{
			throw new LRException(LRException.MESSAGE_INVALID);
		}
		
		// Build an object factory from the signature input stream and try to get an object out of it
		Object o = null;
		try
		{
			PGPObjectFactory pgpFact = new PGPObjectFactory(PGPUtil.getDecoderStream(isSignature));
			o = pgpFact.nextObject();
		}
		catch (Exception e)
		{
			throw new LRException(LRException.SIGNATURE_INVALID);
		}
			
		// Check if the object we fetched is a signature list and if it is, get the signature and use it to verfiy
		try
		{
			if (o instanceof PGPSignatureList)
			{
				PGPSignatureList list = (PGPSignatureList)o;
				if (list.size() > 0)
				{
					PGPSignature sig = list.get(0);
					
					PGPPublicKey publicKey = pgpRings.getPublicKey(sig.getKeyID());
					sig.init(new JcaPGPContentVerifierBuilderProvider().setProvider("BC"), publicKey);
					
					sig.update(bOut.toByteArray());
					verify = sig.verify();
				}
			}
		}
		catch (Exception e)
		{
			throw new LRException(LRException.SIGNATURE_NOT_FOUND);
		}
		
		return verify;
	}
1216451
private final boolean checkHeader(int signature)
    {
        // check the signature
        // Trie in big-endian US-ASCII (0x54726965).
        // Magic number to authenticate the data.
        if (signature != HEADER_SIGNATURE_) {
            return false;
        }

        if ((m_options_ & HEADER_OPTIONS_SHIFT_MASK_) !=
                                                    INDEX_STAGE_1_SHIFT_ ||
            ((m_options_ >> HEADER_OPTIONS_INDEX_SHIFT_) &
                                                HEADER_OPTIONS_SHIFT_MASK_)
                                                 != INDEX_STAGE_2_SHIFT_) {
            return false;
        }
        return true;
    }
744036
private static boolean verifySignature(String content, String signed, RSAPublicKey pk) throws InvalidTokenException {
        try {
            byte[] signedData = Base64.urlDecode(signed);
            byte[] contentData = content.getBytes(JWT.UTF_8);

            Signature signature = Signature.getInstance(ALG_SHA256WITHRSA);
            signature.initVerify(pk);
            signature.update(contentData);

            return signature.verify(signedData);
        }catch (SignatureException e) {
            throw new InvalidTokenException("Invalid signature", e);
        }catch (Exception e) {
            throw new RuntimeException("Verify signature error", e);
        }
    }
1049867
private boolean verifySignature(X509Certificate cert)
        throws CertPathValidatorException {

        try {
            Signature respSignature = Signature.getInstance(sigAlgId.getName());
            respSignature.initVerify(cert.getPublicKey());
            respSignature.update(tbsResponseData);

            if (respSignature.verify(signature)) {
                if (debug != null) {
                    debug.println("Verified signature of OCSP Response");
                }
                return true;

            } else {
                if (debug != null) {
                    debug.println(
                        "Error verifying signature of OCSP Response");
                }
                return false;
            }
        } catch (InvalidKeyException | NoSuchAlgorithmException |
                 SignatureException e)
        {
            throw new CertPathValidatorException(e);
        }
    }
1318853
def verify_signatures?
      return false if ENV['OVERCOMMIT_NO_VERIFY']
      return true if @hash['verify_signatures'] != false

      result = Overcommit::Utils.execute(
        %W[git config --local --get #{verify_signature_config_key}]
      )

      if result.status == 1 # Key doesn't exist
        return true
      elsif result.status != 0
        raise Overcommit::Exceptions::GitConfigError,
              "Unable to read from local repo git config: #{result.stderr}"
      end

      # We don't cast since we want to allow anything to count as "true" except
      # a literal zero
      result.stdout.strip != '0'
    end
1248481
private boolean isValid(final Map<String, String> properties) {

		if (!licensePresent) {
			return false;
		}


		final SimpleDateFormat format = new SimpleDateFormat(DatePattern);
		final String src              = collectLicenseFieldsForSignature(properties);
		final String name             = properties.get(NameKey);
		final String key              = properties.get(SignatureKey);
		final String hostId           = properties.get(MachineKey);
		final String thisHostId       = createHash();
		final String edition          = properties.get(EditionKey);
		final String modules          = properties.get(ModulesKey);
		final String dateString       = properties.get(DateKey);
		final String startDateString  = properties.get(StartKey);
		final String endDateString    = properties.get(EndKey);
		final String serversString    = properties.get(ServersKey);
		final String usersString      = properties.get(UsersKey); // unused (cannot be verified here)
		final Date now                = new Date();

		if (StringUtils.isEmpty(key)) {

			logger.error("Unable to read key from license file.");
			return false;
		}

		startDate = parseDate(startDateString);
		endDate   = parseDate(endDateString);

		try {

			final byte[] data      = src.getBytes(CharSet);
			final Signature signer = Signature.getInstance(SignatureAlgorithm);
			final byte[] signature = Hex.decodeHex(key.toCharArray());

			signer.initVerify(certificate);
			signer.update(data);

			if (!signer.verify(signature)) {

				logger.error("License signature verification failed, license is not valid.");
				return false;
			}

		} catch (Throwable t) {

			logger.error("Unable to verify license.", t);
			return false;
		}

		if (StringUtils.isEmpty(name)) {

			logger.error("License file doesn't contain licensee name.");
			return false;
		}

		if (StringUtils.isEmpty(edition)) {

			logger.error("License file doesn't contain edition.");
			return false;
		}

		if (StringUtils.isEmpty(modules)) {

			logger.error("License file doesn't contain modules.");
			return false;
		}

		if (StringUtils.isEmpty(hostId)) {

			logger.error("License file doesn't contain host ID.");
			return false;
		}

		if (StringUtils.isEmpty(dateString)) {

			logger.error("License file doesn't contain license date.");
			return false;
		}

		if (StringUtils.isEmpty(startDateString)) {

			logger.error("License file doesn't contain start date.");
			return false;
		}

		if (StringUtils.isEmpty(endDateString)) {

			logger.error("License file doesn't contain end date.");
			return false;
		}

		// verify host ID
		if (!thisHostId.equals(hostId) && !"*".equals(hostId)) {

			logger.error("Host ID found in license ({}) file does not match current host ID.", hostId);
			return false;
		}

		if ("*".equals(hostId)) {

			// check volume license against server addresses
			if (StringUtils.isNotBlank(serversString)) {

				// send HostID to server
				properties.put(HostIdKey, thisHostId);

				return checkVolumeLicense(properties, serversString);
			}

			final Calendar issuedAtPlusOneMonth = GregorianCalendar.getInstance();
			final Calendar cal                  = GregorianCalendar.getInstance();

			// set issuedAt to license date plus one month
			issuedAtPlusOneMonth.setTime(parseDate(dateString));
			issuedAtPlusOneMonth.add(Calendar.MONTH, 1);

			// check that the license file was issued not more than one month ago
			if (cal.after(issuedAtPlusOneMonth)) {

				logger.error("Development license found in license file is not valid any more, license period ended {}.", format.format(issuedAtPlusOneMonth.getTime()));
				return false;
			}
		}

		// verify that the license is valid for the current date
		if (startDate != null && now.before(startDate) && !now.equals(startDate)) {

			logger.error("License found in license file is not yet valid, license period starts {}.", format.format(startDate.getTime()));
			return false;
		}

		// verify that the license is valid for the current date
		if (licenseExpired()) {

			logger.error("License found in license file is not valid any more, license period ended {}.", format.format(endDate.getTime()));
			return false;
		}

		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)
841635
def signed?
            begin
                self.Catalog.AcroForm.is_a?(Dictionary) and
                self.Catalog.AcroForm.SigFlags.is_a?(Integer) and
                (self.Catalog.AcroForm.SigFlags & InteractiveForm::SigFlags::SIGNATURES_EXIST != 0)
            rescue InvalidReferenceError
                false
            end
        end
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);
  }
468574
public void apply(Message m, byte [] old)
throws IOException, SignatureException, InvalidKeyException,
       NoSuchAlgorithmException
{
	
	int validity = Options.intValue("sig0validity");
	if (validity < 0)
		validity = VALIDITY;

	long now = System.currentTimeMillis();
	Date timeSigned = new Date(now);
	Date timeExpires = new Date(now + validity * 1000);
	
	String algorithmName;
	if (algorithm == DNSSEC.DSA) {
		algorithmName = "SHA1withDSA";
	} else if (algorithm == DNSSEC.RSAMD5) {
		algorithmName = "MD5withRSA";
	} else if (algorithm == DNSSEC.RSASHA1) {
		algorithmName = "SHA1withRSA";
	} else {
		throw new NoSuchAlgorithmException("Unknown algorithm");
	}

	SIGRecord tmpsig = new SIGRecord(Name.root, DClass.ANY, 0, 0,
					 algorithm, 0, timeExpires, timeSigned,
					 footprint, name, null);
	
	byte [] outBytes = DNSSEC.digestMessage(tmpsig, m, old);
	
	Signature signer = Signature.getInstance(algorithmName);
	signer.initSign(privateKey);
	signer.update(outBytes);
	byte [] signature = signer.sign();

	/*
	 * RSA signatures are already in correct format, but Java DSA
	 * routines use ASN.1; convert this to SIG format.
	 */
	if (algorithm == DNSSEC.DSA) {
		DSAKey dsakey = (DSAKey) privateKey;
		signature = DSASignature.toDNS(dsakey.getParams(), signature);
	}
	
	SIGRecord sig = new SIGRecord(Name.root, DClass.ANY, 0, 0, algorithm,
				      0, timeExpires, timeSigned, footprint,
				      name, signature);
	m.addRecord(sig, Section.ADDITIONAL);
}
958559
private boolean verifyFingreprint() {

        try {
            PackageInfo info = context
                    .getPackageManager()
                    .getPackageInfo(NOKIA_INSTALLER, PackageManager.GET_SIGNATURES);

            if (info.signatures.length == 1) {
                byte[] cert = info.signatures[0].toByteArray();
                MessageDigest digest;
                digest = MessageDigest.getInstance("SHA1");
                byte[] ENABLER_FINGERPRINT = digest.digest(cert);
                byte[] EXPECTED_FINGERPRINT = hexStringToByteArray(EXPECTED_SHA1_FINGERPRINT);

                if (Arrays.equals(ENABLER_FINGERPRINT, EXPECTED_FINGERPRINT)) {
                    Logger.i("isBillingAvailable", "NIAP signature verified");
                    return true;
                }
            }
        } catch (NoSuchAlgorithmException e) {
            e.printStackTrace();
        } catch (PackageManager.NameNotFoundException e) {
            e.printStackTrace();
        }
        return false;
    }
1264466
function verify (transaction) {
	var remove = 64;

	if (transaction.signSignature) {
		remove = 128;
	}

	var bytes = getBytes(transaction);
	var data2 = Buffer.alloc(bytes.length - remove);

	for (var i = 0; i < data2.length; i++) {
		data2[i] = bytes[i];
	}

	var hash = crypto.createHash('sha256').update(data2.toString('hex'), 'hex').digest();

	var signatureBuffer = Buffer.from(transaction.signature, 'hex');
	var senderPublicKeyBuffer = Buffer.from(transaction.senderPublicKey, 'hex');
	var res = naclInstance.crypto_sign_verify_detached(signatureBuffer, hash, senderPublicKeyBuffer);

	return res;
}
1058880
public static boolean ensureSameSignature(Context context, String targetPackageName) {
        return ensureSameSignature(context, targetPackageName, getSignatureHexCode(context));
    }
67043
private void maybeInstantiateVerifier() throws IOException {
        if (jv != null) {
            return;
        }

        if (verify) {
            String[] names = getMetaInfEntryNames();
            if (names != null) {
                for (int i = 0; i < names.length; i++) {
                    String name = names[i].toUpperCase(Locale.ENGLISH);
                    if (name.endsWith(".DSA") ||
                        name.endsWith(".RSA") ||
                        name.endsWith(".EC") ||
                        name.endsWith(".SF")) {
                        // Assume since we found a signature-related file
                        // that the jar is signed and that we therefore
                        // need a JarVerifier and Manifest
                        getManifest();
                        return;
                    }
                }
            }
            // No signature-related files; don't instantiate a
            // verifier
            verify = false;
        }
    }
1164515
def old_signing_text(self):
        """"""
        result = []
        lower_cmp = lambda x, y: cmp(x[0].lower(), y[0].lower())
        for key, value in sorted(self.params.items(), cmp=lower_cmp):
            result.append("%s%s" % (key, value))
        return "".join(result)
104147
private function checkSignature() 
    {
        if ($this->signature !== false && $this->timestamp !== false && $this->nonce !== false) {
            $tmp_signature = SHA1::getSignature($this->token, $this->timestamp, $this->nonce);
            if ($tmp_signature === false) {
                error_log('Validate signature error.', 0);
            } else if ($tmp_signature === $this->signature) {
                return true;
            }
        }
        return false;
    }