Skip to content
Snippets Groups Projects
Commit 05a3c3fe authored by Tim van Dijen's avatar Tim van Dijen Committed by Tim van Dijen
Browse files

Remove unused method

parent b580bb67
No related branches found
No related tags found
No related merge requests found
......@@ -123,43 +123,6 @@ class Message
}
/**
* Find the certificate used to sign a message or assertion.
*
* An exception is thrown if we are unable to locate the certificate.
*
* @param array $certFingerprints The fingerprints we are looking for.
* @param array $certificates Array of certificates.
*
* @return string Certificate, in PEM-format.
*
* @throws \SimpleSAML\Error\Exception if we cannot find the certificate matching the fingerprint.
*/
private static function findCertificate(array $certFingerprints, array $certificates): string
{
$candidates = [];
foreach ($certificates as $cert) {
$fp = strtolower(sha1(base64_decode($cert)));
if (!in_array($fp, $certFingerprints, true)) {
$candidates[] = $fp;
continue;
}
/* We have found a matching fingerprint. */
$pem = "-----BEGIN CERTIFICATE-----\n" .
chunk_split($cert, 64) .
"-----END CERTIFICATE-----\n";
return $pem;
}
$candidates = "'" . implode("', '", $candidates) . "'";
$fps = "'" . implode("', '", $certFingerprints) . "'";
throw new SSP_Error\Exception('Unable to find a certificate matching the configured ' .
'fingerprint. Candidates: ' . $candidates . '; certFingerprint: ' . $fps . '.');
}
/**
* Check the signature on a SAML2 message or assertion.
*
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment