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:----Obe4VZyFkWRB5whN7DkuZnS0/lt15Vz6nV0++mc9LL+OszZ9zvA6osYha743Kfh2UNh95F1FpH5IEpTPuNUDZP1Dz+pg6RIGNe930n3fbd8leicNc6GuZB5HI6mFrzJSzYRWWHfZdUiNd/laHwag5UpRunls0yHZiX1DgYL6RLsNlcTL+GEEooVBRmxXGXpaTcuQCP+PfO3LNoi4ppufXdHLPcxTw61XAn9wZI+as8xofiAvSWWpGGeQHT7kF3OoohUY3J9ddBOr5T9LMM5Da0LMVL72iiN7UVLd00PjeJnKTOuDnXZ+lwgwkBv5YakYRlD1oZnpVAZGCCY8ceijEMRZiQ/YNBkp0T1MOehL95eB0M3v81CnOSTEG3s+20a0zb3K/JBgmweIcY+kqXwxsjXAVIiWkJwpFsFEN47/WQHwmIJv12sMCgFQIwrk58mWrttRGy+KRXa2jOVkMLsY/+fF15kDDyxxNR1FVSdsHhMG7iazLfmf7dd5qD9yIP045woLrs6ODXYL6UaJ2Y1D0Jpr8DmQqiA8lIBukwKASTe60xZyV8JrjMJ/0tRb3QfFwRe+MShC5soxf1S9yzJRoSVHNfe+tiyLvTATCpl2szZAFRAZA2DPDqsLJfqoS50l/zrkIDMA5wimVcL1BZPCfmFI7VUK5Ihxn+fVXwSUs+o=----ATTACHMENT:----NDg3NTg0NzY4OTc2NjUzIDkzNDQ0OTc0NDc2MDQ5MjUgOTkyNTAxNjU2MDk5NzEyNg==