1 | <?php |
||
23 | class SSHFP implements RdataInterface |
||
24 | { |
||
25 | 1 | use RdataTrait; |
|
26 | |||
27 | const TYPE = 'SSHFP'; |
||
28 | const TYPE_CODE = 44; |
||
29 | const ALGORITHM_RSA = 1; |
||
30 | const ALGORITHM_DSA = 2; |
||
31 | const FP_TYPE_SHA1 = 1; |
||
32 | |||
33 | /** |
||
34 | * 8-bit algorithm designate. |
||
35 | * |
||
36 | * @var int |
||
37 | */ |
||
38 | private $algorithm; |
||
39 | |||
40 | /** |
||
41 | * 8-bit Fingerprint type. |
||
42 | * |
||
43 | * @var int |
||
44 | */ |
||
45 | private $fingerprintType = self::FP_TYPE_SHA1; |
||
46 | |||
47 | /** |
||
48 | * Hexadecimal string. |
||
49 | * |
||
50 | * @var string |
||
51 | */ |
||
52 | private $fingerprint; |
||
53 | |||
54 | 2 | public function getAlgorithm(): int |
|
58 | |||
59 | /** |
||
60 | * @throws \InvalidArgumentException |
||
61 | */ |
||
62 | 10 | public function setAlgorithm(int $algorithm): void |
|
69 | |||
70 | 2 | public function getFingerprintType(): int |
|
74 | |||
75 | /** |
||
76 | * @throws \InvalidArgumentException |
||
77 | */ |
||
78 | 8 | public function setFingerprintType(int $fingerprintType): void |
|
85 | |||
86 | 2 | public function getFingerprint(): string |
|
90 | |||
91 | 6 | public function setFingerprint(string $fingerprint): void |
|
95 | |||
96 | 2 | public function toText(): string |
|
100 | |||
101 | 1 | public function toWire(): string |
|
105 | |||
106 | /** |
||
107 | * @throws ParseException |
||
108 | */ |
||
109 | 2 | public function fromText(string $text): void |
|
120 | |||
121 | 1 | public function fromWire(string $rdata, int &$offset = 0, ?int $rdLength = null): void |
|
133 | } |
||
134 |