feat: encrypted user passwords
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
<?php
|
||||
|
||||
namespace App\Command;
|
||||
|
||||
use Spatie\Crypto\Rsa\KeyPair;
|
||||
use Symfony\Component\Console\Attribute\AsCommand;
|
||||
use Symfony\Component\Console\Command\Command;
|
||||
use Symfony\Component\Console\Input\InputInterface;
|
||||
use Symfony\Component\Console\Output\OutputInterface;
|
||||
|
||||
#[AsCommand(name: 'app:crypto:generate-keys', description: 'Generate keypair for encryption')]
|
||||
class GenerateKeysCommand extends Command
|
||||
{
|
||||
public function __construct(private readonly string $path)
|
||||
{
|
||||
parent::__construct();
|
||||
}
|
||||
|
||||
protected function execute(InputInterface $input, OutputInterface $output): int
|
||||
{
|
||||
(new KeyPair())->generate($this->path.'/private.key', $this->path.'/public.key');
|
||||
|
||||
return Command::SUCCESS;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user