loadKeys() 공개 메소드

Loads the keys given, optionally excluding keys when a usage is given and they are not configured to be used with the usage given
public loadKeys ( array $configuredKeys, $usage )
$configuredKeys array
$usage
예제 #1
0
 /**
  * @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));
 }
예제 #2
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));
 }