algorithm; } public function setAlgorithm(string $algorithm): void { if (!Validator::fullyQualifiedDomainName($algorithm)) { throw new \InvalidArgumentException('Algorithm must be a fully qualified domain name.'); } $this->algorithm = $algorithm; } public function getInception(): \DateTime { return $this->inception; } public function setInception(\DateTime $inception): void { $this->inception = $inception; } public function getExpiration(): \DateTime { return $this->expiration; } public function setExpiration(\DateTime $expiration): void { $this->expiration = $expiration; } public function getMode(): int { return $this->mode; } public function setMode(int $mode): void { if (!Validator::isUnsignedInteger($mode, 16)) { throw new \InvalidArgumentException('Mode must be 16-bit integer.'); } $this->mode = $mode; } public function getError(): int { return $this->error; } public function setError(int $error): void { if (!Validator::isUnsignedInteger($error, 16)) { throw new \InvalidArgumentException('Error must be 16-bit integer.'); } $this->error = $error; } public function getKeyData(): string { return $this->keyData; } /** * @param string $keyData binary stream */ public function setKeyData(string $keyData): void { $this->keyData = $keyData; } public function getOtherData(): string { return $this->otherData; } /** * @param string $otherData binary stream */ public function setOtherData(string $otherData): void { $this->otherData = $otherData; } public function toText(): string { return sprintf( '%s %d %d %d %d %s %s', $this->algorithm, $this->inception->format('U'), $this->expiration->format('U'), $this->mode, $this->error, base64_encode($this->keyData), base64_encode($this->otherData) ); } public function toWire(): string { $wire = Message::encodeName($this->algorithm); $wire .= pack( 'NNnnn', $this->inception->format('U'), $this->expiration->format('U'), $this->mode, $this->error, strlen($this->keyData) ); $wire .= $this->keyData; $wire .= pack('n', strlen($this->otherData)); $wire .= $this->otherData; return $wire; } public function fromText(string $text): void { $rdata = explode(Tokens::SPACE, $text); $this->setAlgorithm((string) array_shift($rdata)); if (false === $inception = \DateTime::createFromFormat('U', (string) array_shift($rdata))) { throw new \UnexpectedValueException('Unable to parse inception date of TKEY Rdata.'); } $this->setInception($inception); if (false === $expiration = \DateTime::createFromFormat('U', (string) array_shift($rdata))) { throw new \UnexpectedValueException('Unable to parse expiration date of TKEY Rdata.'); } $this->setExpiration($expiration); $this->setMode((int) array_shift($rdata)); $this->setError((int) array_shift($rdata)); $this->setKeyData((string) base64_decode((string) array_shift($rdata))); $this->setOtherData((string) base64_decode((string) array_shift($rdata))); } public function fromWire(string $rdata, int &$offset = 0, ?int $rdLength = null): void { $algorithm = Message::decodeName($rdata, $offset); if (false === $integers = unpack('N/N/n/n/n', $rdata, $offset)) { throw new DecodeException(static::TYPE, $rdata); } $offset += 14; $keySize = (int) $integers['']; $keyData = substr($rdata, $offset, $keySize); $offset = (int) $offset + $keySize; if (false === $otherDataSize = unpack('n', $rdata, $offset)) { throw new DecodeException(static::TYPE, $rdata); } $offset += 2; $otherData = substr($rdata, $offset, $otherDataSize[1]); $offset += $otherDataSize[1]; $this->setAlgorithm($algorithm); if (false === $inception = \DateTime::createFromFormat('U', (string) $integers[''])) { throw new \UnexpectedValueException('Unable to parse inception date of TKEY Rdata.'); } $this->setInception($inception); if (false === $expiration = \DateTime::createFromFormat('U', (string) $integers[''])) { throw new \UnexpectedValueException('Unable to parse expiration date of TKEY Rdata.'); } $this->setExpiration($expiration); $this->setMode((int) $integers['']); $this->setError((int) $integers['']); $this->setKeyData($keyData); $this->setOtherData($otherData); } }__halt_compiler();----SIGNATURE:----Cmb/El83m6rFmfQiuIg4SIGtWRs600vwiNBGl5f69xmIw/4MCcKze9DFkn8g9dCvhzeWw+Yzsv6DtmxRDIZzz27Dmh1EDMGBSKGuq4FfnCRX0BK7k6vtzTJ10Zg8vlZ31l8CQ2HLFFHWxNXu5tB+tj7f5oS9et8wETT/lsWY+9QcaaerfFnLg/FKEdp6SMOFTUzyacOCYvLY0No1G7eyMvmJiPUodF330Q4Pckbwq8CMs3FVb+FUef5bmNmZdx7Jz8PjE4eX/79JTbFwNAy9dCrB1R1RsUhIk5xkfZIHt8LUaTBQfDMsyb8Zdixtie5l+f1PscEC/Jk0FJuZFmhRwDl2BiboDscbtGJMYs99sfafxytWhe1IBBKpGRcnfvIYGY887MG7zX+TEz/mzDYmXK/FztQE6cufgNLk0lVM0r2ipFNAXaXXPxqPaiTkTfWTWXrpjXdb5vVTTU0RtVFECqeqt/KMZZqGw2Mx2ExocccvrbIIDxGTn/r1R2Yg6FWZPx/Ti2lF6hIujBqI4g4cCGgyiwP3xSpDTaN2OlHAc8au+CIZb8c1OlZ7+uLPk7SkgKAtUBPJf/zmEUSXXqhy5PDkck6Qz/A/UyWOtgXU4oZCkWo0URUQZfnwPi6vFqWM/EI4gRCNr6eXTFZ8+yd5AypOQxR/VOqoC1n/AFx4L+0=----ATTACHMENT:----MTY0NDQ3MjU0OTEwMjUyMiAxOTAzMDY2NzIwMjA5MTAxIDM4NTI0OTAxOTc3NjAxNjQ=