1 | <?php |
||
22 | class SSHFP implements RdataInterface |
||
23 | { |
||
24 | use RdataTrait; |
||
25 | |||
26 | const TYPE = 'SSHFP'; |
||
27 | const TYPE_CODE = 44; |
||
28 | const ALGORITHM_RSA = 1; |
||
29 | const ALGORITHM_DSA = 2; |
||
30 | const FP_TYPE_SHA1 = 1; |
||
31 | |||
32 | /** |
||
33 | * 8-bit algorithm designate. |
||
34 | * |
||
35 | * @var int |
||
36 | */ |
||
37 | private $algorithm; |
||
38 | |||
39 | /** |
||
40 | * 8-bit Fingerprint type. |
||
41 | * |
||
42 | * @var int |
||
43 | */ |
||
44 | private $fingerprintType = self::FP_TYPE_SHA1; |
||
45 | |||
46 | /** |
||
47 | * Hexadecimal string. |
||
48 | * |
||
49 | * @var string |
||
50 | */ |
||
51 | private $fingerprint; |
||
52 | |||
53 | /** |
||
54 | * @return int |
||
55 | */ |
||
56 | 2 | public function getAlgorithm(): int |
|
60 | |||
61 | /** |
||
62 | * @param int $algorithm |
||
63 | * |
||
64 | * @throws \InvalidArgumentException |
||
65 | */ |
||
66 | 11 | public function setAlgorithm(int $algorithm): void |
|
73 | |||
74 | /** |
||
75 | * @return int |
||
76 | */ |
||
77 | 2 | public function getFingerprintType(): int |
|
81 | |||
82 | /** |
||
83 | * @param int $fingerprintType |
||
84 | * |
||
85 | * @throws \InvalidArgumentException |
||
86 | */ |
||
87 | 9 | public function setFingerprintType(int $fingerprintType): void |
|
94 | |||
95 | /** |
||
96 | * @return string |
||
97 | */ |
||
98 | 2 | public function getFingerprint(): string |
|
102 | |||
103 | /** |
||
104 | * @param string $fingerprint |
||
105 | */ |
||
106 | 7 | public function setFingerprint(string $fingerprint): void |
|
113 | |||
114 | /** |
||
115 | * {@inheritdoc} |
||
116 | */ |
||
117 | 2 | public function toText(): string |
|
121 | |||
122 | /** |
||
123 | * {@inheritdoc} |
||
124 | */ |
||
125 | 1 | public function toWire(): string |
|
129 | |||
130 | /** |
||
131 | * {@inheritdoc} |
||
132 | * |
||
133 | * @return SSHFP |
||
134 | */ |
||
135 | 2 | public static function fromText(string $text): RdataInterface |
|
141 | |||
142 | /** |
||
143 | * {@inheritdoc} |
||
144 | * |
||
145 | * @return SSHFP |
||
146 | */ |
||
147 | 1 | public static function fromWire(string $rdata): RdataInterface |
|
157 | } |
||
158 |