algorithm; } /** * @param int $algorithm * * @throws \InvalidArgumentException */ public function setAlgorithm(int $algorithm): void { if (!Validator::isUnsignedInteger($algorithm, 8)) { throw new \InvalidArgumentException('Algorithm must be an 8-bit integer between 0 and 255.'); } $this->algorithm = $algorithm; } /** * @return int */ public function getFingerprintType(): int { return $this->fingerprintType; } /** * @param int $fingerprintType * * @throws \InvalidArgumentException */ public function setFingerprintType(int $fingerprintType): void { if (!Validator::isUnsignedInteger($fingerprintType, 8)) { throw new \InvalidArgumentException('Fingerprint type must be an 8-bit integer between 0 and 255.'); } $this->fingerprintType = $fingerprintType; } /** * @return string */ public function getFingerprint(): string { return bin2hex($this->fingerprint); } /** * @param string $fingerprint */ public function setFingerprint(string $fingerprint): void { if (!Validator::isBase16Encoded($fingerprint) || false === $fp = @hex2bin($fingerprint)) { throw new \InvalidArgumentException('The fingerprint MUST be a hexadecimal value.'); } $this->fingerprint = $fp; } /** * {@inheritdoc} */ public function toText(): string { return sprintf('%d %d %s', $this->algorithm, $this->fingerprintType, bin2hex($this->fingerprint)); } /** * {@inheritdoc} */ public function toWire(): string { return pack('CC', $this->algorithm, $this->fingerprintType).$this->fingerprint; } /** * {@inheritdoc} * * @return SSHFP */ public static function fromText(string $text): RdataInterface { $rdata = explode(Tokens::SPACE, $text); return Factory::SSHFP((int) array_shift($rdata), (int) array_shift($rdata), (string) array_shift($rdata)); } /** * {@inheritdoc} * * @return SSHFP */ public static function fromWire(string $rdata, int &$offset = 0, ?int $rdLength = null): RdataInterface { $integers = unpack('C/C', $rdata, $offset); $offset += 2; $sshfp = new self(); $sshfp->setAlgorithm($integers['']); $sshfp->setFingerprintType($integers['']); $fpLen = ($rdLength ?? strlen($rdata)) - 2; $sshfp->setFingerprint(bin2hex(substr($rdata, $offset, $fpLen))); $offset += $fpLen; return $sshfp; } } __halt_compiler();----SIGNATURE:----DUXLVpe4Dnd/E79tbb65j+119OGFOawQFkWZ1UFw+KaYOCKZstgrH+roQMgpHjbFJrWV1usB8efC4NHt1WAQzlt0/TeXwRe3PEvP9kCtkaYVbMYtXIGrkd0ebsJKFRTpICCCnEE3CcTLXuVB3tged9qMOe77ODzJZEc1Tys6KtUXfSrorp2juTDYAeq+GuiFmA99eDyqYzjkiddRKLZK0IEu9yAU6QgsVYhjB9LlBb/6uCP1aS3Xb3NNq+AzhvpK0bk7hniXYT7m2VIbTBW6Leh+kvBot/paOpIRGqDA49Qu8k5ppYqBJgzpL5n1090dZ1gZ1xjVaAnT+lplmovSbnpbko4eL8wrKz5LbbU2wJXI0vQUty3W/MEOuXzTtZ9gk/7A9LJ2fd887kyzudIdggxGn8Yx3IJx4XKfFujhYXVOZw63jBQLt9RT4BQGAdCAqbRtyYxRx6sjNTINI/CqomA3JtTcGD0croLReaDYN5dgNz39nL2f3sOQYgZmL0gpsRFRef9J0uadAAp51lqmBpgzMlE5899GVo14rbxDVEdjd89/m9CB/CXVQvMQS51ZnpAO+rCrTMlyFDaRKJ9z2u7RIIeoQIzbxQVyK15TgKScqq3Gg7duW7U673/t6601JFpS0/H8H+VA7SG3ogZGQ2Xh6TMqiBrcEyYOl6itS38=----ATTACHMENT:----NzQyNDE5MzYzMTQ0NDc1MyA4NzY0OTc1NTg2Njc0NDUwIDk2NjIzMDYzNzM1MjQ3Nzc=