public static function Utilities::checkSign in SAML SP 2.0 Single Sign On (SSO) - SAML Service Provider 8
1 call to Utilities::checkSign()
File
- src/
Utilities.php, line 499
Class
- Utilities
- This file is part of miniOrange SAML plugin.
Namespace
Drupal\miniorange_samlCode
public static function checkSign($certFingerprint, $signatureData, $ResCert) {
$certificates = $signatureData['Certificates'];
if (count($certificates) === 0) {
return FALSE;
}
else {
$fpArray = array();
$fpArray[] = $certFingerprint;
$pemCert = self::findCertificate($fpArray, $certificates, $ResCert);
}
$lastException = NULL;
$key = new XMLSecurityKey(XMLSecurityKey::RSA_SHA1, array(
'type' => 'public',
));
$key
->loadKey($pemCert);
try {
/* Make sure that we have a valid signature */
self::validateSignature($signatureData, $key);
return TRUE;
} catch (Exception $e) {
$lastException = $e;
}
/* We were unable to validate the signature with any of our keys. */
if ($lastException !== NULL) {
throw $lastException;
}
else {
return FALSE;
}
}