addArgument('file', InputArgument::REQUIRED, 'Filename of the X.509 certificate.'); } protected function execute(InputInterface $input, OutputInterface $output): int { $file = $input->getArgument('file'); if (! is_string($file)) { throw new InvalidArgumentException('Invalid file'); } $args = []; foreach (['use', 'alg'] as $key) { $value = $input->getOption($key); if ($value !== null) { $args[$key] = $value; } } $jwk = JWKFactory::createFromCertificateFile($file, $args); $this->prepareJsonOutput($input, $output, $jwk); return self::SUCCESS; } }