src/LightSaml/Validator/Model/Signature/SignatureValidator.php
public function validate(AbstractSignatureReader $signature, $issuer, $metadataType)
    {
        $query = $this->credentialResolver->query();
        $query
            ->add(new EntityIdCriteria($issuer))
            ->add(new MetadataCriteria($metadataType, SamlConstants::VERSION_20))
            ->add(new UsageCriteria(UsageType::SIGNING))
        ;
        if ($signature->getKey() && $signature->getKey()->getX509Thumbprint()) {
            $query->add(new PublicKeyThumbprintCriteria($signature->getKey()->getX509Thumbprint()));
        }
        $query->resolve();

        $credentialCandidates = $query->allCredentials();
        if (empty($credentialCandidates)) {
            throw new LightSamlSecurityException('No credentials resolved for signature verification');
        }
        $credential = $signature->validateMulti($credentialCandidates);

        return $credential;
    }
public function validate(AbstractSignatureReader $signature, $issuer, $metadataType)
    {
        $query = $this->credentialResolver->query();
        $query
            ->add(new EntityIdCriteria($issuer))
            ->add(new MetadataCriteria($metadataType, SamlConstants::VERSION_20))
            ->add(new UsageCriteria(UsageType::SIGNING))
        ;
        if ($signature->getKey() && $signature->getKey()->getX509Thumbprint()) {
            $query->add(new PublicKeyThumbprintCriteria($signature->getKey()->getX509Thumbprint()));
        }
        $query->resolve();

        $credentialCandidates = $query->allCredentials();
        if (empty($credentialCandidates)) {
            throw new LightSamlSecurityException('No credentials resolved for signature verification');
        }
        $credential = $signature->validateMulti($credentialCandidates);

        return $credential;
    }
@param AbstractSignatureReader $signature
@param string                  $issuer
@param string                  $metadataType

@return CredentialInterface|null