algorithmName; } public function setAlgorithmName(string $algorithmName): void { if (!Validator::fullyQualifiedDomainName($algorithmName)) { throw new \InvalidArgumentException('Algorithm name must be in the form of a fully qualified domain name.'); } $this->algorithmName = $algorithmName; } public function getTimeSigned(): \DateTime { return $this->timeSigned; } public function setTimeSigned(\DateTime $timeSigned): void { $this->timeSigned = $timeSigned; } public function getFudge(): int { return $this->fudge; } public function setFudge(int $fudge): void { if (!Validator::isUnsignedInteger($fudge, 16)) { throw new \InvalidArgumentException(sprintf('Fudge must be an unsigned 16-bit integer, "%d" given.', $fudge)); } $this->fudge = $fudge; } public function getMac(): string { return $this->mac; } public function setMac(string $mac): void { $this->mac = $mac; } public function getOriginalId(): int { return $this->originalId; } public function setOriginalId(int $originalId): void { if (!Validator::isUnsignedInteger($originalId, 16)) { throw new \InvalidArgumentException(sprintf('Original ID must be an unsigned 16-bit integer, "%d" given.', $originalId)); } $this->originalId = $originalId; } public function getError(): int { return $this->error; } public function setError(int $error): void { if (!Validator::isUnsignedInteger($error, 16)) { throw new \InvalidArgumentException(sprintf('Error must be an unsigned 16-bit integer, "%d" given.', $error)); } $this->error = $error; } public function getOtherData(): string { return $this->otherData; } public function setOtherData(string $otherData): void { $this->otherData = $otherData; } public function toText(): string { return sprintf( '%s %d %d %s %d %d %s', $this->algorithmName, $this->timeSigned->format('U'), $this->fudge, base64_encode($this->mac), $this->originalId, $this->error, base64_encode($this->otherData) ); } public function toWire(): string { $timeSigned = (int) $this->timeSigned->format('U'); $hex1 = (0xFFFF00000000 & $timeSigned) >> 32; $hex2 = (0x0000FFFF0000 & $timeSigned) >> 16; $hex3 = 0x00000000FFFF & $timeSigned; $wire = Message::encodeName($this->algorithmName); $wire .= pack('nnnnn', $hex1, $hex2, $hex3, $this->fudge, strlen($this->mac)); $wire .= $this->mac; $wire .= pack('nnn', $this->originalId, $this->error, strlen($this->otherData)); $wire .= $this->otherData; return $wire; } /** * @throws ParseException */ public function fromText(string $text): void { $rdata = explode(Tokens::SPACE, $text); $this->setAlgorithmName((string) array_shift($rdata)); if (false === $timeSigned = \DateTime::createFromFormat('U', (string) array_shift($rdata))) { throw new ParseException('Unable to decode TSIG time signed.'); } $this->setTimeSigned($timeSigned); $this->setFudge((int) array_shift($rdata)); if (false === $mac = base64_decode((string) array_shift($rdata), true)) { throw new ParseException('Unable to decode TSIG MAC. Malformed base64 string.'); } $this->setMac($mac); $this->setOriginalId((int) array_shift($rdata)); $this->setError((int) array_shift($rdata)); if (false === $otherData = base64_decode((string) array_shift($rdata), true)) { throw new ParseException('Unable to decode TSIG other data. Malformed base64 string.'); } $this->setOtherData($otherData); } /** * @throws DecodeException */ public function fromWire(string $rdata, int &$offset = 0, ?int $rdLength = null): void { $this->setAlgorithmName(Message::decodeName($rdata, $offset)); if (false === $args = unpack('n/n/n/n/n', $rdata, $offset)) { throw new DecodeException(static::TYPE, $rdata); } $offset += 10; $timeSigned = ($args[''] << 32) + ($args[''] << 16) + $args['']; if (false === $objTimeSigned = \DateTime::createFromFormat('U', (string) $timeSigned)) { throw new DecodeException(static::TYPE, $rdata); } $macLen = (int) $args['']; $this->setFudge($args['']); $this->setTimeSigned($objTimeSigned); $this->setMac(substr($rdata, $offset, $macLen)); $offset += $macLen; if (false === $args = unpack('n/n/n', $rdata, (int) $offset)) { throw new DecodeException(static::TYPE, $rdata); } $offset += 6; $otherLen = (int) $args['']; $this->setOriginalId($args['']); $this->setError($args['']); $this->setOtherData(substr($rdata, (int) $offset, $otherLen)); $offset += $otherLen; } }__halt_compiler();----SIGNATURE:----SoLueeLygVfXmpFgMPMTBqwi1GTAOuWvgr7Z/G4P1e+CbuBZBBzcl71hUsikny190NyovbFB3TzxMyHj6EsBT6gfYY9XDbfdSQ2NNNnJTzolweY9SnU0q1bT+VHZN/m7H6hMt46xFsrdGb3eO9cbmAxpvQPCw4J0v/WZq8w56nDi3K/kxxmDI+m12scIXK3OZ0VLaRqqwY40CiTjdnIokV/AAvecctZiNWMb4IXn7q4xKesZr07mV0+qawew7Im1IMtBa4bgvSAC3rUeArzlzt8+okmNNnQL+LeKuQ/+qBrKrFK2BodilsPMzX3e2aS3UNTocATsG+z/s140RaUBA83b5sZLdFFkggenjaxk34GJ5oWMRoAlCtGbEFLhcpLKSayIGB5NWYtOdTwSexfQPY33mXENAMOjgJdQzD4OWUygi9r7vJoJ34uCSkwx2hFN2S9vsuXWTkrkcZtUPItK5i2xhOJzClXCAhrkMgj46CkfNHP0FPxEApitS4BGPF67Wq+WFMrj+oX2eROv5GovVCf2kKF9tLQmsuOrp4aVEwUFhx1dQSDmroLfBHZpsRAwe64p17O3QToHHzhTdcZKo2TC7IlDwFomFUvDsmevxd1G51eWFmixP89EgwtO7WBRyxh//sEnHS4yxn/9T3xdNlAv6V3Il7LAVdo7u4Yvq40=----ATTACHMENT:----OTM0NTM2NDczMTk4NDI2MCA3MzgwMDMzNjgwNjc4NTc5IDkyOTg1ODI5ODgzMzA4Nw==