SAML2\Certificate\KeyLoader::getKeys PHP Method

getKeys() public method

public getKeys ( ) : SAML2\Certificate\KeyCollection
return SAML2\Certificate\KeyCollection
    public function getKeys()
    {
        return $this->loadedKeys;
    }

Usage Example

Example #1
0
 /**
  * @group certificate
  *
  * @test
  */
 public function loading_a_certificate_from_file_creates_a_key()
 {
     $file = dirname(__FILE__) . '/File/example.org.crt';
     $this->keyLoader->loadCertificateFile($file);
     $loadedKeys = $this->keyLoader->getKeys();
     $loadedKey = $loadedKeys->get(0);
     $fileContents = file_get_contents($file);
     preg_match(Certificate::CERTIFICATE_PATTERN, $fileContents, $matches);
     $expected = preg_replace('~\\s+~', '', $matches[1]);
     $this->assertTrue($this->keyLoader->hasKeys());
     $this->assertCount(1, $loadedKeys);
     $this->assertEquals($expected, $loadedKey['X509Certificate']);
 }