/** * @param \SAML2\SignedElement $signedElement * @param \SAML2\Configuration\CertificateProvider $configuration * * @return bool */ public function canValidate(SignedElement $signedElement, CertificateProvider $configuration) { $this->configuredKeys = $this->keyLoader->extractPublicKeys($configuration); return !!count($this->configuredKeys); }
/** * @group certificate * * @test * @expectedException \SAML2\Certificate\Exception\InvalidCertificateStructureException */ public function loading_an_invalid_certificate_file_from_configuration_throws_exception() { $file = dirname(__FILE__) . '/File/not_a_key.crt'; $this->configurationMock->shouldReceive('getKeys')->atMost()->once()->andReturnNull()->shouldReceive('getCertificateData')->atMost()->once()->andReturnNull()->shouldReceive('getCertificateFile')->once()->andReturn($file); $loadedKeys = $this->keyLoader->loadKeysFromConfiguration($this->configurationMock); }