for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/*
* The MIT License (MIT)
*
* Copyright (c) 2014-2017 Spomky-Labs
* This software may be modified and distributed under the terms
* of the MIT license. See the LICENSE file for details.
*/
namespace Jose\Object;
/**
* Class PublicJWKSet.
final class PublicJWKSet extends BaseJWKSet implements JWKSetInterface
{
use JWKSetPEM;
* @var \Jose\Object\JWKSetInterface
private $jwkset;
* PublicJWKSet constructor.
* @param \Jose\Object\JWKSetInterface $jwkset
public function __construct(JWKSetInterface $jwkset)
$this->jwkset = $jwkset;
}
* {@inheritdoc}
public function getKeys()
$keys = [];
foreach ($this->jwkset->getKeys() as $key) {
if (in_array($key->get('kty'), ['none', 'oct'])) {
continue;
$keys[] = $key->toPublic();
return $keys;
public function addKey(JWKInterface $key)
$this->jwkset->addKey($key);
public function prependKey(JWKInterface $key)
$this->jwkset->prependKey($key);
public function removeKey($index)
//Not available