You are here

public function SAML2_Assertion::validate in SAML SP 2.0 Single Sign On (SSO) - SAML Service Provider 7

Validate this assertion against a public key.

If no signature was present on the assertion, we will return FALSE. Otherwise, TRUE will be returned. An exception is thrown if the signature validation fails.

Parameters

XMLSecurityKey $key The key we should check against.:

Return value

boolean TRUE if successful, FALSE if it is unsigned.

File

includes/Assertion.php, line 387

Class

SAML2_Assertion

Code

public function validate(XMLSecurityKey $key) {
  assert('$key->type === XMLSecurityKey::RSA_SHA1');
  if ($this->signatureData === NULL) {
    return FALSE;
  }
  Utilities::validateSignature($this->signatureData, $key);
  return TRUE;
}