Jose\Object\JWKSetInterface::getKey PHP Method

getKey() public method

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

Usage Example

 /**
  * @param array $payload
  *
  * @return string
  */
 private function sign(array $payload)
 {
     $payload = array_merge($payload, $this->getAdditionalPayload());
     $headers = $this->getSignatureHeaders();
     $signature_key = $this->signature_jwkset->getKey(0);
     if ($signature_key->has('kid')) {
         $headers['kid'] = $signature_key->get('kid');
     }
     return $this->jwt_creator->sign($payload, $headers, $signature_key);
 }
All Usage Examples Of Jose\Object\JWKSetInterface::getKey