1 | <?php |
||
23 | class TKEY implements RdataInterface |
||
24 | { |
||
25 | 1 | use RdataTrait; |
|
26 | |||
27 | const TYPE = 'TKEY'; |
||
28 | const TYPE_CODE = 249; |
||
29 | |||
30 | /** |
||
31 | * The algorithm name is in the form of a domain name with the same |
||
32 | * meaning as in [RFC 2845]{@link https://tools.ietf.org/html/rfc2845}. |
||
33 | * The algorithm determines how the secret keying material agreed to |
||
34 | * using the TKEY RR is actually used to derive the algorithm specific key. |
||
35 | * |
||
36 | * @var string |
||
37 | */ |
||
38 | private $algorithm; |
||
39 | |||
40 | /** |
||
41 | * @var \DateTime |
||
42 | */ |
||
43 | private $inception; |
||
44 | |||
45 | /** |
||
46 | * @var \DateTime |
||
47 | */ |
||
48 | private $expiration; |
||
49 | |||
50 | /** |
||
51 | * The mode field specifies the general scheme for key agreement or the |
||
52 | * purpose of the TKEY DNS message. 16-bit integer. |
||
53 | * |
||
54 | * The following values of the Mode octet are defined, available, or reserved: |
||
55 | * |
||
56 | * Value Description |
||
57 | * ----- ----------- |
||
58 | * 0 - reserved, see section 7 |
||
59 | * 1 server assignment |
||
60 | * 2 Diffie-Hellman exchange |
||
61 | * 3 GSS-API negotiation |
||
62 | * 4 resolver assignment |
||
63 | * 5 key deletion |
||
64 | * 6-65534 - available, see section 7 |
||
65 | * 65535 - reserved, see section 7 |
||
66 | * |
||
67 | * @var int |
||
68 | */ |
||
69 | private $mode; |
||
70 | |||
71 | /** |
||
72 | * The error code field is an extended RCODE. The following values are defined:. |
||
73 | * |
||
74 | * Value Description |
||
75 | * ----- ----------- |
||
76 | * 0 - no error |
||
77 | * 1-15 a non-extended RCODE |
||
78 | * 16 BADSIG (TSIG) |
||
79 | * 17 BADKEY (TSIG) |
||
80 | * 18 BADTIME (TSIG) |
||
81 | * 19 BADMODE |
||
82 | * 20 BADNAME |
||
83 | * 21 BADALG |
||
84 | * |
||
85 | * @var int |
||
86 | */ |
||
87 | private $error = 0; |
||
88 | |||
89 | /** |
||
90 | * @var string |
||
91 | */ |
||
92 | private $keyData; |
||
93 | |||
94 | /** |
||
95 | * @var string |
||
96 | */ |
||
97 | private $otherData; |
||
98 | |||
99 | 1 | public function getAlgorithm(): string |
|
103 | |||
104 | 4 | public function setAlgorithm(string $algorithm): void |
|
111 | |||
112 | 1 | public function getInception(): \DateTime |
|
116 | |||
117 | 4 | public function setInception(\DateTime $inception): void |
|
121 | |||
122 | 1 | public function getExpiration(): \DateTime |
|
126 | |||
127 | 4 | public function setExpiration(\DateTime $expiration): void |
|
131 | |||
132 | 1 | public function getMode(): int |
|
136 | |||
137 | 4 | public function setMode(int $mode): void |
|
144 | |||
145 | 1 | public function getError(): int |
|
149 | |||
150 | 4 | public function setError(int $error): void |
|
157 | |||
158 | 1 | public function getKeyData(): string |
|
162 | |||
163 | /** |
||
164 | * @param string $keyData binary stream |
||
165 | */ |
||
166 | 4 | public function setKeyData(string $keyData): void |
|
170 | |||
171 | 1 | public function getOtherData(): string |
|
175 | |||
176 | /** |
||
177 | * @param string $otherData binary stream |
||
178 | */ |
||
179 | 4 | public function setOtherData(string $otherData): void |
|
183 | |||
184 | 1 | public function toText(): string |
|
196 | |||
197 | 1 | public function toWire(): string |
|
213 | |||
214 | 1 | public function fromText(string $text): void |
|
233 | |||
234 | 1 | public function fromWire(string $rdata, int &$offset = 0, ?int $rdLength = null): void |
|
268 | } |
||
269 |