@@ -43,20 +43,8 @@ class DNSKEY extends AbstractResourceRecordType
4343 /**
4444 * Algorithm
4545 *
46- * |Value |Algorithm [Mnemonic] | Signing | References| Status |
47- * |------|----------------------|---------|-----------|---------|
48- * |0 | reserved | |
49- * |1 | RSA/MD5 [RSAMD5] | n | [RFC2537] | NOT RECOMMENDED |
50- * |2 | Diffie-Hellman [DH] | n | [RFC2539] | - |
51- * |3 | DSA/SHA-1 [DSA] | y | [RFC2536] | OPTIONAL|
52- * |4 | Elliptic Curve [ECC] | | TBA | - |
53- * |5 | RSA/SHA-1 [RSASHA1] | y | [RFC3110] | MANDATORY|
54- * |252 | Indirect [INDIRECT] | n | | - |
55- * |253 | Private [PRIVATEDNS] | y | - | OPTIONAL |
56- * |254 | Private [PRIVATEOID] | y | - | OPTIONAL |
57- * |255 | reserved | |
58- *
5946 * @var int $algorithm
47+ * @link https://www.iana.org/assignments/dns-sec-alg-numbers/dns-sec-alg-numbers.xhtml#table-dns-sec-alg-numbers-1
6048 */
6149 protected int $ algorithm ;
6250
@@ -118,5 +106,56 @@ protected function parseRData(string $message, int $rdataOffset): void
118106 $ this ->zoneKey = ((int )$ flags [7 ]) === 1 ;
119107 $ this ->zoneSep = ((int )$ flags [15 ]) === 1 ;
120108 }
109+
110+ public function getProtocol (): int
111+ {
112+ return $ this ->protocol ;
113+ }
114+
115+ public function getAlgorithm (): int
116+ {
117+ return $ this ->algorithm ;
118+ }
119+
120+ public function getFlags (): int
121+ {
122+ return $ this ->flags ;
123+ }
124+
125+ public function getPublicKey (): string
126+ {
127+ return $ this ->publicKey ;
128+ }
129+
130+ public function getKeyTag (): int
131+ {
132+ return $ this ->keyTag ;
133+ }
134+
135+ public function isZoneKey (): bool
136+ {
137+ return $ this ->zoneKey ;
138+ }
139+
140+ public function isZoneSep (): bool
141+ {
142+ return $ this ->zoneSep ;
143+ }
144+
145+ public function toArray (): array
146+ {
147+ return [
148+ 'host ' => $ this ->getName (),
149+ 'class ' => $ this ->getClass ()->getName (),
150+ 'ttl ' => $ this ->getTTL (),
151+ 'type ' => $ this ->getType ()->getName (),
152+ 'flags ' => $ this ->getFlags (),
153+ 'protocol ' => $ this ->getProtocol (),
154+ 'algorithm ' => $ this ->getAlgorithm (),
155+ 'keytag ' => $ this ->getKeyTag (),
156+ 'zonekey ' => $ this ->isZoneKey (),
157+ 'zonesep ' => $ this ->isZoneSep (),
158+ 'pubkey ' => $ this ->getPublicKey (),
159+ ];
160+ }
121161}
122- // @todo add toArray()
0 commit comments