1 | <?php |
||
19 | final class RandomKeySet extends AbstractJWKSetSource |
||
20 | { |
||
21 | /** |
||
22 | * {@inheritdoc} |
||
23 | */ |
||
24 | public function createDefinition(ContainerBuilder $container, array $config) |
||
25 | { |
||
26 | if (true === $config['is_rotatable']) { |
||
27 | $definition = new Definition('Jose\Object\RotatableJWKSet'); |
||
28 | $method = 'createRotatableKeySet'; |
||
29 | } else { |
||
30 | $definition = new Definition('Jose\Object\StorableJWKSet'); |
||
31 | $method = 'createStorableKeySet'; |
||
32 | } |
||
33 | |||
34 | $definition->setFactory([ |
||
35 | new Reference('jose.factory.jwk'), |
||
36 | $method, |
||
37 | ]); |
||
38 | $definition->setArguments([ |
||
39 | $config['storage_path'], |
||
40 | $config['key_configuration'], |
||
41 | $config['nb_keys'], |
||
42 | ]); |
||
43 | |||
44 | return $definition; |
||
45 | } |
||
46 | |||
47 | /** |
||
48 | * {@inheritdoc} |
||
49 | */ |
||
50 | public function getKeySet() |
||
54 | |||
55 | /** |
||
56 | * {@inheritdoc} |
||
57 | */ |
||
58 | public function addConfiguration(NodeDefinition $node) |
||
80 | } |
||
81 |