1 | <?php |
||
19 | final class JWTCreator |
||
20 | { |
||
21 | /** |
||
22 | * @var \Jose\EncrypterInterface|null |
||
23 | */ |
||
24 | private $encrypter = null; |
||
25 | |||
26 | /** |
||
27 | * @var \Jose\SignerInterface |
||
28 | */ |
||
29 | private $signer; |
||
30 | |||
31 | /** |
||
32 | * JWTCreator constructor. |
||
33 | * |
||
34 | * @param \Jose\SignerInterface $signer |
||
35 | */ |
||
36 | public function __construct(SignerInterface $signer) |
||
40 | |||
41 | /** |
||
42 | * @param \Jose\EncrypterInterface $encrypter |
||
43 | */ |
||
44 | public function enableEncryptionSupport(EncrypterInterface $encrypter) |
||
48 | |||
49 | /** |
||
50 | * @param mixed $payload |
||
51 | * @param array $signature_protected_headers |
||
52 | * @param \Jose\Object\JWKInterface $signature_key |
||
53 | * |
||
54 | * @return string |
||
55 | */ |
||
56 | public function sign($payload, array $signature_protected_headers, JWKInterface $signature_key) |
||
65 | |||
66 | /** |
||
67 | * @param string $payload |
||
68 | * @param array $encryption_protected_headers |
||
69 | * @param \Jose\Object\JWKInterface $encryption_key |
||
70 | * |
||
71 | * @return string |
||
72 | */ |
||
73 | public function encrypt($payload, array $encryption_protected_headers, JWKInterface $encryption_key) |
||
83 | |||
84 | /** |
||
85 | * @param mixed $payload |
||
86 | * @param array $signature_protected_headers |
||
87 | * @param \Jose\Object\JWKInterface $signature_key |
||
88 | * @param array $encryption_protected_headers |
||
89 | * @param \Jose\Object\JWKInterface $encryption_key |
||
90 | * |
||
91 | * @return string |
||
92 | */ |
||
93 | public function signAndEncrypt($payload, array $signature_protected_headers, JWKInterface $signature_key, array $encryption_protected_headers, JWKInterface $encryption_key) |
||
100 | |||
101 | /** |
||
102 | * @return string[] |
||
103 | */ |
||
104 | public function getSupportedSignatureAlgorithms() |
||
108 | |||
109 | /** |
||
110 | * @return string[] |
||
111 | */ |
||
112 | public function getSupportedKeyEncryptionAlgorithms() |
||
116 | |||
117 | /** |
||
118 | * @return string[] |
||
119 | */ |
||
120 | public function getSupportedContentEncryptionAlgorithms() |
||
124 | |||
125 | /** |
||
126 | * @return string[] |
||
127 | */ |
||
128 | public function getSupportedCompressionMethods() |
||
132 | |||
133 | /** |
||
134 | * @return bool |
||
135 | */ |
||
136 | public function isEncryptionSupportEnabled() |
||
140 | } |
||
141 |