1 | <?php |
||
27 | final class ServiceFactory |
||
28 | { |
||
29 | /** |
||
30 | * @var \SpomkyLabs\JoseBundle\Service\AlgorithmManager |
||
31 | */ |
||
32 | private $algorithm_manager; |
||
33 | |||
34 | /** |
||
35 | * @var \SpomkyLabs\JoseBundle\Service\CompressionManager |
||
36 | */ |
||
37 | private $compression_manager; |
||
38 | |||
39 | /** |
||
40 | * @var \SpomkyLabs\JoseBundle\Service\CheckerManager |
||
41 | */ |
||
42 | private $checker_manager; |
||
43 | |||
44 | /** |
||
45 | * ServiceFactory constructor. |
||
46 | * |
||
47 | * @param \SpomkyLabs\JoseBundle\Service\AlgorithmManager $algorithm_manager |
||
48 | * @param \SpomkyLabs\JoseBundle\Service\CompressionManager $compression_manager |
||
49 | * @param \SpomkyLabs\JoseBundle\Service\CheckerManager $checker_manager |
||
50 | */ |
||
51 | public function __construct(AlgorithmManager $algorithm_manager, CompressionManager $compression_manager, CheckerManager $checker_manager) |
||
57 | |||
58 | /** |
||
59 | * @param string[] $selected_key_encryption_algorithms |
||
60 | * @param string[] $selected_content_encryption_algorithms |
||
61 | * @param string[] $selected_compression_methods |
||
62 | * |
||
63 | * @return \Jose\EncrypterInterface |
||
64 | */ |
||
65 | public function createEncrypter(array $selected_key_encryption_algorithms, array $selected_content_encryption_algorithms, array $selected_compression_methods) |
||
73 | |||
74 | /** |
||
75 | * @param string[] $selected_key_encryption_algorithms |
||
76 | * @param string[] $selected_content_encryption_algorithms |
||
77 | * @param string[] $selected_compression_methods |
||
78 | * |
||
79 | * @return \Jose\DecrypterInterface |
||
80 | */ |
||
81 | public function createDecrypter(array $selected_key_encryption_algorithms, array $selected_content_encryption_algorithms, array $selected_compression_methods) |
||
89 | |||
90 | /** |
||
91 | * @param string[] $selected_algorithms |
||
92 | * |
||
93 | * @return \Jose\SignerInterface |
||
94 | */ |
||
95 | public function createSigner(array $selected_algorithms) |
||
101 | |||
102 | /** |
||
103 | * @param string[] $selected_algorithms |
||
104 | * |
||
105 | * @return \Jose\VerifierInterface |
||
106 | */ |
||
107 | public function createVerifier(array $selected_algorithms) |
||
113 | |||
114 | /** |
||
115 | * @param string[] $selected_claim_checkers |
||
116 | * @param string[] $selected_header_checkers |
||
117 | * |
||
118 | * @return \Jose\Checker\CheckerManagerInterface |
||
119 | */ |
||
120 | public function createChecker(array $selected_claim_checkers, array $selected_header_checkers) |
||
127 | |||
128 | /** |
||
129 | * @param \Jose\Checker\CheckerManagerInterface $checker_manager |
||
130 | * @param \Jose\VerifierInterface $verifier |
||
131 | * @param \Jose\DecrypterInterface|null $decrypter |
||
132 | * |
||
133 | * @return \Jose\JWTLoader |
||
134 | */ |
||
135 | public function createJWTLoader(CheckerManagerInterface $checker_manager, VerifierInterface $verifier, DecrypterInterface $decrypter = null) |
||
144 | |||
145 | /** |
||
146 | * @param \Jose\SignerInterface $signer |
||
147 | * @param \Jose\EncrypterInterface|null $encrypter |
||
148 | * |
||
149 | * @return \Jose\JWTCreator |
||
150 | */ |
||
151 | public function createJWTCreator(SignerInterface $signer, EncrypterInterface $encrypter = null) |
||
160 | } |
||
161 |