/** * @group certificate * * @test */ public function load_keys_constructs_x509_certificate() { $keys = array(array('X509Certificate' => $this->certificate)); $this->keyLoader->loadKeys($keys, null); $loadedKeys = $this->keyLoader->getKeys(); $this->assertCount(1, $loadedKeys); $this->assertInstanceOf('SAML2\\Certificate\\X509', $loadedKeys->get(0)); }
/** * @group certificate * * @test */ public function load_keys_checks_for_usage_of_key() { $signing = array(Key::USAGE_SIGNING => true); $encryption = array(Key::USAGE_ENCRYPTION => true); $keys = array($signing, $encryption); $this->keyLoader->loadKeys($keys, Key::USAGE_SIGNING); $loadedKeys = $this->keyLoader->getKeys(); $this->assertCount(1, $loadedKeys, 'Amount of keys that have been loaded does not match the expected amount'); $this->assertTrue($loadedKeys->get(0)->canBeUsedFor(Key::USAGE_SIGNING)); }