/** * Constructor * * @param JWKParameter ...$params * @throws \UnexpectedValueException If missing required parameter */ public function __construct(JWKParameter ...$params) { parent::__construct(...$params); foreach (self::MANAGED_PARAMS as $name) { if (!$this->has($name)) { throw new \UnexpectedValueException("Missing '{$name}' parameter."); } } if ($this->keyTypeParameter()->value() != KeyTypeParameter::TYPE_OCT) { throw new \UnexpectedValueException("Invalid key type."); } }