1 | <?php |
||
24 | class TSIG implements RdataInterface |
||
25 | { |
||
26 | use RdataTrait; |
||
27 | |||
28 | const TYPE = 'TSIG'; |
||
29 | const TYPE_CODE = 250; |
||
30 | |||
31 | /** |
||
32 | * Name of the algorithm in domain name syntax. |
||
33 | * |
||
34 | * @var string |
||
35 | */ |
||
36 | private $algorithmName; |
||
37 | |||
38 | /** |
||
39 | * @var \DateTime |
||
40 | */ |
||
41 | private $timeSigned; |
||
42 | |||
43 | /** |
||
44 | * Seconds of error permitted in time signed. |
||
45 | * |
||
46 | * @var int |
||
47 | */ |
||
48 | private $fudge; |
||
49 | |||
50 | /** |
||
51 | * Message authentication code. |
||
52 | * |
||
53 | * @var string |
||
54 | */ |
||
55 | private $mac; |
||
56 | |||
57 | /** |
||
58 | * @var int |
||
59 | */ |
||
60 | private $originalId; |
||
61 | |||
62 | /** |
||
63 | * @var int |
||
64 | */ |
||
65 | private $error = Rcode::NOERROR; |
||
66 | |||
67 | /** |
||
68 | * @var string |
||
69 | */ |
||
70 | private $otherData; |
||
71 | |||
72 | /** |
||
73 | * @return string |
||
74 | */ |
||
75 | 2 | public function getAlgorithmName(): string |
|
79 | |||
80 | /** |
||
81 | * @param string $algorithmName |
||
82 | */ |
||
83 | 4 | public function setAlgorithmName(string $algorithmName): void |
|
91 | |||
92 | /** |
||
93 | * @return \DateTime |
||
94 | */ |
||
95 | 2 | public function getTimeSigned(): \DateTime |
|
99 | |||
100 | /** |
||
101 | * @param \DateTime $timeSigned |
||
102 | */ |
||
103 | 4 | public function setTimeSigned(\DateTime $timeSigned): void |
|
107 | |||
108 | /** |
||
109 | * @return int |
||
110 | */ |
||
111 | 2 | public function getFudge(): int |
|
115 | |||
116 | /** |
||
117 | * @param int $fudge |
||
118 | */ |
||
119 | 4 | public function setFudge(int $fudge): void |
|
126 | |||
127 | /** |
||
128 | * @return string |
||
129 | */ |
||
130 | 2 | public function getMac(): string |
|
134 | |||
135 | /** |
||
136 | * @param string $mac |
||
137 | */ |
||
138 | 4 | public function setMac(string $mac): void |
|
142 | |||
143 | /** |
||
144 | * @return int |
||
145 | */ |
||
146 | 2 | public function getOriginalId(): int |
|
150 | |||
151 | /** |
||
152 | * @param int $originalId |
||
153 | */ |
||
154 | 4 | public function setOriginalId(int $originalId): void |
|
161 | |||
162 | /** |
||
163 | * @return int |
||
164 | */ |
||
165 | 2 | public function getError(): int |
|
169 | |||
170 | /** |
||
171 | * @param int $error |
||
172 | */ |
||
173 | 4 | public function setError(int $error): void |
|
180 | |||
181 | /** |
||
182 | * @return string |
||
183 | */ |
||
184 | 2 | public function getOtherData(): string |
|
188 | |||
189 | /** |
||
190 | * @param string $otherData |
||
191 | */ |
||
192 | 4 | public function setOtherData(string $otherData): void |
|
196 | |||
197 | /** |
||
198 | * {@inheritdoc} |
||
199 | */ |
||
200 | 1 | public function toText(): string |
|
212 | |||
213 | /** |
||
214 | * {@inheritdoc} |
||
215 | */ |
||
216 | 1 | public function toWire(): string |
|
231 | |||
232 | /** |
||
233 | * {@inheritdoc} |
||
234 | * |
||
235 | * @return TSIG |
||
236 | * |
||
237 | * @throws ParseException |
||
238 | */ |
||
239 | 1 | public static function fromText(string $text): RdataInterface |
|
265 | |||
266 | /** |
||
267 | * {@inheritdoc} |
||
268 | * |
||
269 | * @throws DecodeException |
||
270 | * |
||
271 | * @return TSIG |
||
272 | */ |
||
273 | 1 | public static function fromWire(string $rdata): RdataInterface |
|
302 | } |
||
303 |