public function XMLSecurityDSig::validateDigest in SAML SP 2.0 Single Sign On (SSO) - SAML Service Provider 8
Parameters
$refNode:
string $data:
Return value
bool
1 call to XMLSecurityDSig::validateDigest()
File
- src/
XMLSecurityKey.php, line 1037
Class
Namespace
Drupal\miniorange_samlCode
public function validateDigest($refNode, $data) {
$xpath = new DOMXPath($refNode->ownerDocument);
$xpath
->registerNamespace('secdsig', self::XMLDSIGNS);
$query = 'string(./secdsig:DigestMethod/@Algorithm)';
$digestAlgorithm = $xpath
->evaluate($query, $refNode);
$digValue = $this
->calculateDigest($digestAlgorithm, $data, false);
$query = 'string(./secdsig:DigestValue)';
$digestValue = $xpath
->evaluate($query, $refNode);
return $digValue === base64_decode($digestValue);
}