ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
SAML2\Signature\ValidatorChain Class Reference

Allows for validation of a signature trying different validators till a validator is found that can validate the signature. More...

+ Inheritance diagram for SAML2\Signature\ValidatorChain:
+ Collaboration diagram for SAML2\Signature\ValidatorChain:

Public Member Functions

 __construct (LoggerInterface $logger, array $validators)
 
 appendValidator (ChainedValidator $validator)
 
 hasValidSignature (SignedElement $signedElement, CertificateProvider $configuration)
 

Private Attributes

 $logger
 
 $validators = array()
 

Detailed Description

Allows for validation of a signature trying different validators till a validator is found that can validate the signature.

If no validation is possible an exception is thrown.

Definition at line 15 of file ValidatorChain.php.

Constructor & Destructor Documentation

◆ __construct()

SAML2\Signature\ValidatorChain::__construct ( LoggerInterface  $logger,
array  $validators 
)
Parameters
\Psr\Log\LoggerInterface$logger

Definition at line 31 of file ValidatorChain.php.

References SAML2\Signature\ValidatorChain\$logger, and SAML2\Signature\ValidatorChain\appendValidator().

32  {
33  $this->logger = $logger;
34 
35  // should be done through "adder" injection in the container.
36  foreach ($validators as $validator) {
37  $this->appendValidator($validator);
38  }
39  }
appendValidator(ChainedValidator $validator)
+ Here is the call graph for this function:

Member Function Documentation

◆ appendValidator()

SAML2\Signature\ValidatorChain::appendValidator ( ChainedValidator  $validator)
Parameters
\SAML2\Signature\ChainedValidator$validator

Definition at line 44 of file ValidatorChain.php.

Referenced by SAML2\Signature\ValidatorChain\__construct().

45  {
46  $this->validators[] = $validator;
47  }
+ Here is the caller graph for this function:

◆ hasValidSignature()

SAML2\Signature\ValidatorChain::hasValidSignature ( SignedElement  $signedElement,
CertificateProvider  $configuration 
)
Parameters
\SAML2\SignedElement$signedElement
\SAML2\Configuration\CertificateProvider$configuration
Returns
bool

Implements SAML2\Signature\ValidatorInterface.

Definition at line 55 of file ValidatorChain.php.

References SAML2\Configuration\Queryable\get(), and SAML2\Configuration\Queryable\has().

58  {
59  foreach ($this->validators as $validator) {
60  if ($validator->canValidate($signedElement, $configuration)) {
61  $this->logger->debug(sprintf(
62  'Validating the signed element with validator of type "%s"',
63  get_class($validator)
64  ));
65 
66  return $validator->hasValidSignature($signedElement, $configuration);
67  }
68 
69  $this->logger->debug(sprintf(
70  'Could not validate the signed element with validator of type "%s"',
71  get_class($validator)
72  ));
73  }
74 
75  throw new MissingConfigurationException(sprintf(
76  'No certificates or fingerprints have been configured%s',
77  $configuration->has('entityid') ? ' for "' . $configuration->get('entityid') . '"' : ''
78  ));
79  }
+ Here is the call graph for this function:

Field Documentation

◆ $logger

SAML2\Signature\ValidatorChain::$logger
private

Definition at line 20 of file ValidatorChain.php.

Referenced by SAML2\Signature\ValidatorChain\__construct().

◆ $validators

SAML2\Signature\ValidatorChain::$validators = array()
private

Definition at line 25 of file ValidatorChain.php.


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