Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fgrosse/phpasn1 removed in favor of the S-L PKI framework #414

Closed
wants to merge 25 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
0ffa182
Rebase
Spomky Aug 22, 2022
2b080b5
ECS
Spomky Aug 22, 2022
4e06e30
Rebase 3.1.x
Spomky Dec 17, 2022
343552c
Update phpstan/phpstan-phpunit requirement from ^1.0 to ^1.1
dependabot[bot] Aug 23, 2022
f9f3c8c
Update phpunit/phpunit requirement from ^9.5.5 to ^9.5.23
dependabot[bot] Aug 23, 2022
485624a
Update blackfire/php-sdk requirement from ^1.14 to ^1.31
dependabot[bot] Aug 23, 2022
598024a
Update matthiasnoback/symfony-config-test requirement
dependabot[bot] Aug 23, 2022
1dcf731
Update symfony/dependency-injection requirement from ^5.4|^6.0 to ^6.1.3
dependabot[bot] Aug 23, 2022
0488038
Update symfony/yaml requirement from ^5.4|^6.0 to ^6.1.3
dependabot[bot] Aug 23, 2022
b376451
Update phpstan/phpstan requirement from ^1.0 to ^1.8
dependabot[bot] Aug 23, 2022
9e8f332
Update symfony/browser-kit requirement from ^5.4|^6.0 to ^6.1.3
dependabot[bot] Aug 23, 2022
db45967
Update symfony/http-kernel requirement from ^5.4|^6.0 to ^6.1.3
dependabot[bot] Aug 23, 2022
4dd1a60
Update symfony/phpunit-bridge requirement from ^5.4|^6.0 to ^6.1.3
dependabot[bot] Aug 23, 2022
686466d
Update symfony/event-dispatcher requirement from ^5.4|^6.0 to ^6.1.0
dependabot[bot] Aug 23, 2022
00d8d0c
Update fgrosse/phpasn1 requirement from ^2.0 to ^2.4
dependabot[bot] Aug 23, 2022
fa228ba
Update nyholm/psr7 requirement from ^1.3 to ^1.5
dependabot[bot] Aug 23, 2022
ff24ffa
Update phpstan/phpstan-strict-rules requirement from ^1.0 to ^1.4
dependabot[bot] Aug 23, 2022
ceb076f
Update php-http/mock-client requirement from ^1.0 to ^1.5
dependabot[bot] Aug 23, 2022
02c19fe
Update bjeavons/zxcvbn-php requirement from ^1.0 to ^1.3
dependabot[bot] Aug 23, 2022
2b1ec9e
Update symfony/serializer requirement from ^5.4|^6.0 to ^6.1.3
dependabot[bot] Aug 23, 2022
5bb02dd
Update symfony/var-dumper requirement from ^5.4|^6.0 to ^6.1.3
dependabot[bot] Aug 23, 2022
e41388f
Update symfony/framework-bundle requirement from ^5.4|^6.0 to ^6.1.3
dependabot[bot] Aug 23, 2022
f2a2c13
Update symfony/polyfill-mbstring requirement from ^1.12 to ^1.26
dependabot[bot] Aug 23, 2022
e982f67
Update symfony/config requirement from ^5.4|^6.0 to ^6.1.3
dependabot[bot] Aug 23, 2022
d741888
Reverted auto-merge dependabot
Spomky Aug 23, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/Component/Console/AddKeyIntoKeysetCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,18 @@
use Jose\Component\Core\JWK;
use Jose\Component\Core\JWKSet;
use Jose\Component\Core\Util\JsonConverter;
use Symfony\Component\Console\Attribute\AsCommand;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;

#[AsCommand(name: 'keyset:add:key', description: 'Add a key into a key set.',)]
final class AddKeyIntoKeysetCommand extends ObjectOutputCommand
{
protected static $defaultName = 'keyset:add:key';

protected function configure(): void
{
parent::configure();
$this->setDescription('Add a key into a key set.')
$this
->setHelp('This command adds a key at the end of a key set.')
->addArgument('jwkset', InputArgument::REQUIRED, 'The JWKSet object')
->addArgument('jwk', InputArgument::REQUIRED, 'The new JWK object');
Expand Down
7 changes: 4 additions & 3 deletions src/Component/Console/EcKeyGeneratorCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,20 @@
use InvalidArgumentException;
use function is_string;
use Jose\Component\KeyManagement\JWKFactory;
use Symfony\Component\Console\Attribute\AsCommand;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;

#[AsCommand(name: 'key:generate:ec', description: 'Generate an EC key (JWK format)',)]
final class EcKeyGeneratorCommand extends GeneratorCommand
{
protected static $defaultName = 'key:generate:ec';

protected function configure(): void
{
parent::configure();
$this->setDescription('Generate an EC key (JWK format)')
->addArgument('curve', InputArgument::REQUIRED, 'Curve of the key.');
->addArgument('curve', InputArgument::REQUIRED, 'Curve of the key.')
;
}

protected function execute(InputInterface $input, OutputInterface $output): int
Expand Down
6 changes: 3 additions & 3 deletions src/Component/Console/EcKeysetGeneratorCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,18 @@
use function is_string;
use Jose\Component\Core\JWKSet;
use Jose\Component\KeyManagement\JWKFactory;
use Symfony\Component\Console\Attribute\AsCommand;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;

#[AsCommand(name: 'keyset:generate:ec', description: 'Generate an EC key set (JWKSet format)',)]
final class EcKeysetGeneratorCommand extends GeneratorCommand
{
protected static $defaultName = 'keyset:generate:ec';

protected function configure(): void
{
parent::configure();
$this->setDescription('Generate an EC key set (JWKSet format)')
$this
->addArgument('quantity', InputArgument::REQUIRED, 'Quantity of keys in the key set.')
->addArgument('curve', InputArgument::REQUIRED, 'Curve of the keys.');
}
Expand Down
6 changes: 3 additions & 3 deletions src/Component/Console/GetThumbprintCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,19 @@
use function is_string;
use Jose\Component\Core\JWK;
use Jose\Component\Core\Util\JsonConverter;
use Symfony\Component\Console\Attribute\AsCommand;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Output\OutputInterface;

#[AsCommand(name: 'key:thumbprint', description: 'Get the thumbprint of a JWK key.',)]
final class GetThumbprintCommand extends ObjectOutputCommand
{
protected static $defaultName = 'key:thumbprint';

protected function configure(): void
{
parent::configure();
$this->setDescription('Get the thumbprint of a JWK key.')
$this
->addArgument('jwk', InputArgument::REQUIRED, 'The JWK key.')
->addOption('hash', null, InputOption::VALUE_OPTIONAL, 'The hashing algorithm.', 'sha256');
}
Expand Down
12 changes: 6 additions & 6 deletions src/Component/Console/JKULoaderCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,27 +7,27 @@
use InvalidArgumentException;
use function is_string;
use Jose\Component\KeyManagement\JKUFactory;
use Symfony\Component\Console\Attribute\AsCommand;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;

#[AsCommand(name: 'keyset:load:jku', description: 'Loads a key set from an url.',)]
final class JKULoaderCommand extends ObjectOutputCommand
{
protected static $defaultName = 'keyset:load:jku';

public function __construct(
private readonly JKUFactory $jkuFactory,
?string $name = null
) {
parent::__construct($name);
parent::__construct();
}

protected function configure(): void
{
parent::configure();
$this->setDescription('Loads a key set from an url.')
$this
->setHelp('This command will try to get a key set from an URL. The distant key set is a JWKSet.')
->addArgument('url', InputArgument::REQUIRED, 'The URL');
->addArgument('url', InputArgument::REQUIRED, 'The URL')
;
}

protected function execute(InputInterface $input, OutputInterface $output): int
Expand Down
9 changes: 4 additions & 5 deletions src/Component/Console/KeyAnalyzerCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,27 +10,26 @@
use Jose\Component\Core\JWK;
use Jose\Component\Core\Util\JsonConverter;
use Jose\Component\KeyManagement\Analyzer\KeyAnalyzerManager;
use Symfony\Component\Console\Attribute\AsCommand;
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Formatter\OutputFormatterStyle;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;

#[AsCommand(name: 'key:analyze', description: 'JWK quality analyzer.',)]
final class KeyAnalyzerCommand extends Command
{
protected static $defaultName = 'key:analyze';

public function __construct(
private readonly KeyAnalyzerManager $analyzerManager,
string $name = null
) {
parent::__construct($name);
parent::__construct();
}

protected function configure(): void
{
parent::configure();
$this->setDescription('JWK quality analyzer.')
$this
->setHelp('This command will analyze a JWK object and find security issues.')
->addArgument('jwk', InputArgument::REQUIRED, 'The JWK object');
}
Expand Down
6 changes: 3 additions & 3 deletions src/Component/Console/KeyFileLoaderCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,19 @@
use InvalidArgumentException;
use function is_string;
use Jose\Component\KeyManagement\JWKFactory;
use Symfony\Component\Console\Attribute\AsCommand;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Output\OutputInterface;

#[AsCommand(name: 'key:load:key', description: 'Loads a key from a key file (JWK format)',)]
final class KeyFileLoaderCommand extends GeneratorCommand
{
protected static $defaultName = 'key:load:key';

protected function configure(): void
{
parent::configure();
$this->setDescription('Loads a key from a key file (JWK format)')
$this
->addArgument('file', InputArgument::REQUIRED, 'Filename of the key.')
->addOption('secret', 's', InputOption::VALUE_OPTIONAL, 'Secret if the key is encrypted.', null);
}
Expand Down
8 changes: 4 additions & 4 deletions src/Component/Console/KeysetAnalyzerCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,28 +12,28 @@
use Jose\Component\KeyManagement\Analyzer\KeyAnalyzerManager;
use Jose\Component\KeyManagement\Analyzer\KeysetAnalyzerManager;
use Jose\Component\KeyManagement\Analyzer\MessageBag;
use Symfony\Component\Console\Attribute\AsCommand;
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Formatter\OutputFormatterStyle;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;

#[AsCommand(name: 'keyset:analyze', description: 'JWKSet quality analyzer.',)]
final class KeysetAnalyzerCommand extends Command
{
protected static $defaultName = 'keyset:analyze';

public function __construct(
private readonly KeysetAnalyzerManager $keysetAnalyzerManager,
private readonly KeyAnalyzerManager $keyAnalyzerManager,
string $name = null
) {
parent::__construct($name);
parent::__construct();
}

protected function configure(): void
{
parent::configure();
$this->setDescription('JWKSet quality analyzer.')
$this
->setHelp('This command will analyze a JWKSet object and find security issues.')
->addArgument('jwkset', InputArgument::REQUIRED, 'The JWKSet object');
}
Expand Down
6 changes: 3 additions & 3 deletions src/Component/Console/MergeKeysetCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,18 @@
use function is_array;
use Jose\Component\Core\JWKSet;
use Jose\Component\Core\Util\JsonConverter;
use Symfony\Component\Console\Attribute\AsCommand;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;

#[AsCommand(name: 'keyset:merge', description: 'Merge several key sets into one.',)]
final class MergeKeysetCommand extends ObjectOutputCommand
{
protected static $defaultName = 'keyset:merge';

protected function configure(): void
{
parent::configure();
$this->setDescription('Merge several key sets into one.')
$this
->setHelp(
'This command merges several key sets into one. It is very useful when you generate e.g. RSA, EC and OKP keys and you want only one key set to rule them all.'
)
Expand Down
15 changes: 5 additions & 10 deletions src/Component/Console/NoneKeyGeneratorCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,21 +5,16 @@
namespace Jose\Component\Console;

use Jose\Component\KeyManagement\JWKFactory;
use Symfony\Component\Console\Attribute\AsCommand;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;

#[AsCommand(
name: 'key:generate:none',
description: 'Generate a none key (JWK format). This key type is only supposed to be used with the "none" algorithm.',
)]
final class NoneKeyGeneratorCommand extends GeneratorCommand
{
protected static $defaultName = 'key:generate:none';

protected function configure(): void
{
parent::configure();
$this->setDescription(
'Generate a none key (JWK format). This key type is only supposed to be used with the "none" algorithm.'
);
}

protected function execute(InputInterface $input, OutputInterface $output): int
{
$args = $this->getOptions($input);
Expand Down
4 changes: 2 additions & 2 deletions src/Component/Console/OctKeyGeneratorCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@

use InvalidArgumentException;
use Jose\Component\KeyManagement\JWKFactory;
use Symfony\Component\Console\Attribute\AsCommand;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;

#[AsCommand(name: 'key:generate:oct', description: 'Generate an octet key (JWK format)',)]
final class OctKeyGeneratorCommand extends GeneratorCommand
{
protected static $defaultName = 'key:generate:oct';

protected function configure(): void
{
parent::configure();
Expand Down
6 changes: 3 additions & 3 deletions src/Component/Console/OctKeysetGeneratorCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,18 @@
use InvalidArgumentException;
use Jose\Component\Core\JWKSet;
use Jose\Component\KeyManagement\JWKFactory;
use Symfony\Component\Console\Attribute\AsCommand;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;

#[AsCommand(name: 'keyset:generate:oct', description: 'Generate a key set with octet keys (JWK format)',)]
final class OctKeysetGeneratorCommand extends GeneratorCommand
{
protected static $defaultName = 'keyset:generate:oct';

protected function configure(): void
{
parent::configure();
$this->setDescription('Generate a key set with octet keys (JWK format)')
$this
->addArgument('quantity', InputArgument::REQUIRED, 'Quantity of keys in the key set.')
->addArgument('size', InputArgument::REQUIRED, 'Key size.');
}
Expand Down
4 changes: 2 additions & 2 deletions src/Component/Console/OkpKeyGeneratorCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@
use InvalidArgumentException;
use function is_string;
use Jose\Component\KeyManagement\JWKFactory;
use Symfony\Component\Console\Attribute\AsCommand;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;

#[AsCommand(name: 'key:generate:okp', description: 'Generate an Octet Key Pair key (JWK format)',)]
final class OkpKeyGeneratorCommand extends GeneratorCommand
{
protected static $defaultName = 'key:generate:okp';

protected function configure(): void
{
parent::configure();
Expand Down
9 changes: 6 additions & 3 deletions src/Component/Console/OkpKeysetGeneratorCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,21 @@
use function is_string;
use Jose\Component\Core\JWKSet;
use Jose\Component\KeyManagement\JWKFactory;
use Symfony\Component\Console\Attribute\AsCommand;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;

#[AsCommand(
name: 'keyset:generate:okp',
description: 'Generate a key set with Octet Key Pairs keys (JWKSet format)',
)]
final class OkpKeysetGeneratorCommand extends GeneratorCommand
{
protected static $defaultName = 'keyset:generate:okp';

protected function configure(): void
{
parent::configure();
$this->setDescription('Generate a key set with Octet Key Pairs keys (JWKSet format)')
$this
->addArgument('quantity', InputArgument::REQUIRED, 'Quantity of keys in the key set.')
->addArgument('curve', InputArgument::REQUIRED, 'Curve of the keys.');
}
Expand Down
9 changes: 5 additions & 4 deletions src/Component/Console/OptimizeRsaKeyCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,20 @@
use Jose\Component\Core\JWK;
use Jose\Component\Core\Util\JsonConverter;
use Jose\Component\KeyManagement\KeyConverter\RSAKey;
use Symfony\Component\Console\Attribute\AsCommand;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;

#[AsCommand(name: 'key:optimize', description: 'Optimize a RSA key by calculating additional primes (CRT).',)]
final class OptimizeRsaKeyCommand extends ObjectOutputCommand
{
protected static $defaultName = 'key:optimize';

protected function configure(): void
{
parent::configure();
$this->setDescription('Optimize a RSA key by calculating additional primes (CRT).')
->addArgument('jwk', InputArgument::REQUIRED, 'The RSA key.');
$this
->addArgument('jwk', InputArgument::REQUIRED, 'The RSA key.')
;
}

protected function execute(InputInterface $input, OutputInterface $output): int
Expand Down
6 changes: 3 additions & 3 deletions src/Component/Console/P12CertificateLoaderCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,19 @@
use InvalidArgumentException;
use function is_string;
use Jose\Component\KeyManagement\JWKFactory;
use Symfony\Component\Console\Attribute\AsCommand;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Output\OutputInterface;

#[AsCommand(name: 'key:load:p12', description: 'Load a key from a P12 certificate file.',)]
final class P12CertificateLoaderCommand extends GeneratorCommand
{
protected static $defaultName = 'key:load:p12';

protected function configure(): void
{
parent::configure();
$this->setDescription('Load a key from a P12 certificate file.')
$this
->addArgument('file', InputArgument::REQUIRED, 'Filename of the P12 certificate.')
->addOption('secret', 's', InputOption::VALUE_OPTIONAL, 'Secret if the key is encrypted.', null);
}
Expand Down
Loading