Jose\Object\JWKSet::getKeys PHP Method

getKeys() public method

public getKeys ( )
    public function getKeys()
    {
        return $this->keys;
    }

Usage Example

コード例 #1
0
ファイル: X5UJWKSet.php プロジェクト: spomky-labs/jose
 /**
  * @return \Jose\Object\JWKInterface[]
  */
 public function getKeys()
 {
     $content = json_decode($this->getContent(), true);
     Assertion::isArray($content, 'Invalid content.');
     $jwkset = new JWKSet();
     foreach ($content as $kid => $cert) {
         $jwk = KeyConverter::loadKeyFromCertificate($cert);
         Assertion::notEmpty($jwk, 'Invalid content.');
         if (is_string($kid)) {
             $jwk['kid'] = $kid;
         }
         $jwkset->addKey(new JWK($jwk));
     }
     return $jwkset->getKeys();
 }