setName('security:certificates:import') ->setDescription('import trusted certificate in PEM format') ->addArgument( 'path', InputArgument::REQUIRED, 'path to the PEM certificate to import' ); } protected function execute(InputInterface $input, OutputInterface $output): int { $path = $input->getArgument('path'); if (!file_exists($path)) { $output->writeln('Certificate not found, please provide a path accessible by the web server user'); return 1; } $certData = file_get_contents($path); $name = basename($path); $this->certificateManager->addCertificate($certData, $name); return 0; } }