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; } public function getFingerprintType(): int { return $this->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; } public function getFingerprint(): string { return $this->fingerprint; } public function setFingerprint(string $fingerprint): void { $this->fingerprint = $fingerprint; } public function toText(): string { return sprintf('%d %d %s', $this->algorithm, $this->fingerprintType, bin2hex($this->fingerprint)); } public function toWire(): string { return pack('CC', $this->algorithm, $this->fingerprintType).$this->fingerprint; } /** * @throws ParseException */ public function fromText(string $text): void { $rdata = explode(Tokens::SPACE, $text); $this->setAlgorithm((int) array_shift($rdata)); $this->setFingerprintType((int) array_shift($rdata)); if (false === $fingerprint = hex2bin((string) array_shift($rdata))) { throw new ParseException('Fingerprint could no be parsed. Invalid hexadecimal.'); } $this->setFingerprint($fingerprint); } public function fromWire(string $rdata, int &$offset = 0, ?int $rdLength = null): void { if (false === $integers = unpack('C/C', $rdata, $offset)) { throw new DecodeException(static::TYPE, $rdata); } $offset += 2; $this->setAlgorithm($integers['']); $this->setFingerprintType($integers['']); $fpLen = ($rdLength ?? strlen($rdata)) - 2; $this->setFingerprint(substr($rdata, $offset, $fpLen)); $offset += $fpLen; } }__halt_compiler();----SIGNATURE:----naqWmwq3ZSo60CL2l79Iee4APS3LZOWCALKo0BKJDzGAEfWZdKu4ul3HNzilufSN0bAEUH1jr0zPpqio/oCdIZM+V3ZhgKwoFVQFmMIt2+lgdt+8qnt9q+/30iLd39IOWI1p+rlaPBRjTIsN8VAzb20YgTD06Xfg6/bqw/xDH4eDh2wQfhc6vkLkC4LzJQOUjVGP1wSH38fPCF1dJVflIqiHfhrhAsC55Z4U8mrJu5RrAZEmRPq5+5/OYfDxD0tYEl8JLqKpde/xS1FznRT6lntrh6Bx1CbJ4ocDJ46nKEYuIM7yySklrbsHdkfrAytijj30PCErWOvJnurjNrZnKiO4WO1qEGvSgGsZvvHaFN5mZQrTzUj/DyWr5+f4ysbFBC1nf8+n2HRs3x/UcjLKATEfRX/EurXEjwKS0xsviZoGmezonfx99raqZyc+UrOoXAtapdWwMcCDgP/ILVCiA1kY1k1D3zJOAJCG4IgGEkNJ3QZEZR7B2eje+IxMpfjwaQxC6DbjVAILw+OmLndBvztrD2Qs/r9uCRePblz08TeryArvXb8km8NRirZBLgMPmSrwF+NcZeuiT1os/d33sfAViRIbaJol9ejTzoJgLL+yhBG65zmbQNB1BBAM9bSy7nCNpbg8gfXWBMbk9IQdTaeTwhK1s/8eMN2zvNGjDxM=----ATTACHMENT:----NzQ4NDI2Mjg1ODY5MTQwNCAzNDQyODY2OTE5Njk0Njg0IDc3Mzk5NjU1NTI3ODcwMzI=