1 | <?php |
||
20 | abstract class RandomKey extends AbstractSource implements JWKSourceInterface |
||
21 | { |
||
22 | /** |
||
23 | * {@inheritdoc} |
||
24 | */ |
||
25 | public function createDefinition(ContainerBuilder $container, array $config) |
||
26 | { |
||
27 | $definition = new Definition('Jose\Object\StorableJWK'); |
||
28 | $definition->setFactory([ |
||
29 | new Reference('jose.factory.jwk'), |
||
30 | 'createStorableKey', |
||
31 | ]); |
||
32 | $definition->setArguments([ |
||
33 | $config['storage_path'], |
||
34 | $this->getKeyConfig($config) |
||
35 | ]); |
||
36 | |||
37 | return $definition; |
||
38 | } |
||
39 | |||
40 | /** |
||
41 | * @param array $config |
||
42 | * |
||
43 | * @return array |
||
44 | */ |
||
45 | abstract protected function getKeyConfig(array $config); |
||
46 | |||
47 | /** |
||
48 | * {@inheritdoc} |
||
49 | */ |
||
50 | public function addConfiguration(NodeDefinition $node) |
||
63 | } |
||
64 |