getKeys() public method

public getKeys ( )
Example #1
0
 /**
  * @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();
 }