PHP Interface Jose\Object\JWKSetInterface

Inheritance: extends Countable, extends Iterator, extends JsonSerializable, extends ArrayAccess
Mostrar archivo Open project: spomky-labs/jose Interface Usage Examples

Public Methods

Method Description
addKey ( Jose\Object\JWKInterface $key ) Add key in the key set.
countKeys ( ) : integer
getKey ( $index ) : Jose\Object\JWKInterface
getKeys ( ) : Jose\Object\JWKInterface[] Returns all keys in the key set.
hasKey ( $index ) : boolean
removeKey ( integer $index ) Remove key from the key set.
selectKey ( string $type, string | null $algorithm = null, array $restrictions = [] ) : Jose\Object\JWKInterface | null
toPEM ( ) : string[] Returns RSA/EC keys in the key set into PEM format Note that if the key set contains other key types (none, oct, OKP.

Method Details

addKey() public method

Add key in the key set.
public addKey ( Jose\Object\JWKInterface $key )
$key Jose\Object\JWKInterface

countKeys() public method

public countKeys ( ) : integer
return integer

getKey() public method

public getKey ( $index ) : Jose\Object\JWKInterface
$index
return Jose\Object\JWKInterface

getKeys() public method

Returns all keys in the key set.
public getKeys ( ) : Jose\Object\JWKInterface[]
return Jose\Object\JWKInterface[] An array of keys stored in the key set

hasKey() public method

public hasKey ( $index ) : boolean
$index
return boolean

removeKey() public method

Remove key from the key set.
public removeKey ( integer $index )
$index integer Key to remove from the key set

selectKey() public method

public selectKey ( string $type, string | null $algorithm = null, array $restrictions = [] ) : Jose\Object\JWKInterface | null
$type string Must be 'sig' (signature) or 'enc' (encryption)
$algorithm string | null Specifies the algorithm to be used
$restrictions array More restrictions such as 'kid' or 'kty'
return Jose\Object\JWKInterface | null

toPEM() public method

..), they will not be part of the result. If keys have a key ID, it is used as index.
public toPEM ( ) : string[]
return string[]