1 | <?php |
||
17 | final class Recipient implements RecipientInterface |
||
18 | { |
||
19 | /** |
||
20 | * @var array |
||
21 | */ |
||
22 | private $headers = []; |
||
23 | |||
24 | /** |
||
25 | * @var null|string |
||
26 | */ |
||
27 | private $encrypted_key = null; |
||
28 | |||
29 | /** |
||
30 | * @var \Jose\Object\JWKInterface |
||
31 | */ |
||
32 | private $recipient_key; |
||
33 | |||
34 | /** |
||
35 | * @param array $headers |
||
36 | * @param string $encrypted_key |
||
37 | * |
||
38 | * @return \Jose\Object\Recipient |
||
39 | */ |
||
40 | public static function createRecipientFromLoadedJWE(array $headers, $encrypted_key) |
||
48 | |||
49 | /** |
||
50 | * @param \Jose\Object\JWKInterface $recipient_key |
||
51 | * @param array $headers |
||
52 | * |
||
53 | * @return \Jose\Object\Recipient |
||
54 | */ |
||
55 | public static function createRecipientForJWEEncryption(JWKInterface $recipient_key, array $headers = []) |
||
63 | |||
64 | /** |
||
65 | * {@inheritdoc} |
||
66 | */ |
||
67 | public function getHeaders() |
||
71 | |||
72 | /** |
||
73 | * {@inheritdoc} |
||
74 | */ |
||
75 | public function withHeaders(array $headers) |
||
82 | |||
83 | /** |
||
84 | * {@inheritdoc} |
||
85 | */ |
||
86 | public function withHeader($key, $value) |
||
93 | |||
94 | /** |
||
95 | * {@inheritdoc} |
||
96 | */ |
||
97 | public function getHeader($key) |
||
104 | |||
105 | /** |
||
106 | * {@inheritdoc} |
||
107 | */ |
||
108 | public function hasHeader($key) |
||
112 | |||
113 | /** |
||
114 | * {@inheritdoc} |
||
115 | */ |
||
116 | public function getEncryptedKey() |
||
120 | |||
121 | /** |
||
122 | * {@inheritdoc} |
||
123 | */ |
||
124 | public function withEncryptedKey($encrypted_key) |
||
131 | |||
132 | /** |
||
133 | * {@inheritdoc} |
||
134 | */ |
||
135 | public function getRecipientKey() |
||
139 | |||
140 | /** |
||
141 | * {@inheritdoc} |
||
142 | */ |
||
143 | public function withRecipientKey(JWKInterface $recipient_key) |
||
150 | } |
||
151 |