1 | <?php |
||
22 | class KEY implements RdataInterface |
||
23 | { |
||
24 | use RdataTrait; |
||
25 | |||
26 | const TYPE = 'KEY'; |
||
27 | const TYPE_CODE = 25; |
||
28 | |||
29 | /** |
||
30 | * {@link https://tools.ietf.org/html/rfc4034#section-2.1.1}. |
||
31 | * |
||
32 | * @var int |
||
33 | */ |
||
34 | protected $flags; |
||
35 | |||
36 | /** |
||
37 | * @var int |
||
38 | */ |
||
39 | protected $protocol; |
||
40 | |||
41 | /** |
||
42 | * The Algorithm field identifies the public key's cryptographic |
||
43 | * algorithm and determines the format of the Public Key field. |
||
44 | * {@link https://tools.ietf.org/html/rfc4034#section-2.1.3}. |
||
45 | * |
||
46 | * @var int |
||
47 | */ |
||
48 | protected $algorithm; |
||
49 | |||
50 | /** |
||
51 | * The Public Key field is a Base64 encoding of the Public Key. |
||
52 | * Whitespace is allowed within the Base64 text. |
||
53 | * {@link https://tools.ietf.org/html/rfc4034#section-2.1.4}. |
||
54 | * |
||
55 | * @var string |
||
56 | */ |
||
57 | protected $publicKey; |
||
58 | |||
59 | /** |
||
60 | * @param int $flags |
||
61 | */ |
||
62 | 4 | public function setFlags(int $flags): void |
|
66 | |||
67 | /** |
||
68 | * @param int $protocol |
||
69 | */ |
||
70 | 2 | public function setProtocol(int $protocol): void |
|
74 | |||
75 | /** |
||
76 | * @param int $algorithm |
||
77 | */ |
||
78 | 4 | public function setAlgorithm(int $algorithm): void |
|
82 | |||
83 | /** |
||
84 | * @param string $publicKey |
||
85 | * |
||
86 | * @throws \InvalidArgumentException |
||
87 | */ |
||
88 | 4 | public function setPublicKey(string $publicKey): void |
|
96 | |||
97 | /** |
||
98 | * @return int |
||
99 | */ |
||
100 | 1 | public function getFlags(): int |
|
104 | |||
105 | /** |
||
106 | * @return int |
||
107 | */ |
||
108 | 1 | public function getProtocol(): int |
|
112 | |||
113 | /** |
||
114 | * @return int |
||
115 | */ |
||
116 | 1 | public function getAlgorithm(): int |
|
120 | |||
121 | /** |
||
122 | * @return string |
||
123 | */ |
||
124 | 1 | public function getPublicKey(): string |
|
128 | |||
129 | /** |
||
130 | * {@inheritdoc} |
||
131 | */ |
||
132 | 2 | public function toText(): string |
|
136 | |||
137 | /** |
||
138 | * {@inheritdoc} |
||
139 | */ |
||
140 | 1 | public function toWire(): string |
|
147 | |||
148 | /** |
||
149 | * {@inheritdoc} |
||
150 | */ |
||
151 | 1 | public static function fromText(string $text): RdataInterface |
|
162 | |||
163 | /** |
||
164 | * {@inheritdoc} |
||
165 | */ |
||
166 | 1 | public static function fromWire(string $rdata): RdataInterface |
|
177 | } |
||
178 |