ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
SAML2\Signature\AbstractChainedValidator Class Reference
+ Inheritance diagram for SAML2\Signature\AbstractChainedValidator:
+ Collaboration diagram for SAML2\Signature\AbstractChainedValidator:

Public Member Functions

 __construct (LoggerInterface $logger)
 
- Public Member Functions inherited from SAML2\Signature\ChainedValidator
 canValidate (SignedElement $signedElement, CertificateProvider $configuration)
 Test whether or not this link in the chain can validate the signedElement signature. More...
 
- Public Member Functions inherited from SAML2\Signature\ValidatorInterface
 hasValidSignature (SignedElement $signedElement, CertificateProvider $configuration)
 Validate the signature of the signed Element based on the configuration. More...
 

Protected Member Functions

 validateElementWithKeys (SignedElement $element, $pemCandidates)
 BC compatible version of the signature check. More...
 

Protected Attributes

 $logger
 

Detailed Description

Definition at line 9 of file AbstractChainedValidator.php.

Constructor & Destructor Documentation

◆ __construct()

SAML2\Signature\AbstractChainedValidator::__construct ( LoggerInterface  $logger)

Member Function Documentation

◆ validateElementWithKeys()

SAML2\Signature\AbstractChainedValidator::validateElementWithKeys ( SignedElement  $element,
  $pemCandidates 
)
protected

BC compatible version of the signature check.

Parameters
\SAML2\SignedElement$element

Definition at line 31 of file AbstractChainedValidator.php.

References $index, $key, $result, array, RobRichards\XMLSecLibs\XMLSecurityKey\RSA_SHA1, and SAML2\SignedElement\validate().

Referenced by SAML2\Signature\FingerprintValidator\canValidate(), and SAML2\Signature\PublicKeyValidator\hasValidSignature().

32  {
33  $lastException = null;
34  foreach ($pemCandidates as $index => $candidateKey) {
35  $key = new XMLSecurityKey(XMLSecurityKey::RSA_SHA1, array('type' => 'public'));
36  $key->loadKey($candidateKey->getCertificate());
37 
38  try {
39  /*
40  * Make sure that we have a valid signature on either the response or the assertion.
41  */
42  $result = $element->validate($key);
43  if ($result) {
44  $this->logger->debug(sprintf('Validation with key "#%d" succeeded', $index));
45  return true;
46  }
47  $this->logger->debug(sprintf('Validation with key "#%d" failed without exception.', $index));
48  } catch (\Exception $e) {
49  $this->logger->debug(sprintf(
50  'Validation with key "#%d" failed with exception: %s',
51  $index,
52  $e->getMessage()
53  ));
54 
55  $lastException = $e;
56  }
57  }
58 
59  if ($lastException !== null) {
60  throw $lastException;
61  } else {
62  return false;
63  }
64  }
$result
$index
Definition: metadata.php:60
Create styles array
The data for the language used.
$key
Definition: croninfo.php:18
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Field Documentation

◆ $logger

SAML2\Signature\AbstractChainedValidator::$logger
protected

The documentation for this class was generated from the following file: