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)
 
 hasValidSignature (SignedElement $signedElement, CertificateProvider $configuration)
 Validate the signature of the signed Element based on the configuration. More...
 

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
\SAML2\Signature\ChainedValidator[]$validators

Definition at line 31 of file ValidatorChain.php.

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)

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

+ 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.

45 {
46 $this->validators[] = $validator;
47 }

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

+ 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.

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 }
sprintf('%.4f', $callTime)

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

+ 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.

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


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