publicKeyAlgorithm; } public function setPublicKeyAlgorithm(int $publicKeyAlgorithm): void { $this->publicKeyAlgorithm = $publicKeyAlgorithm; } public function getHostIdentityTag(): string { return $this->hostIdentityTag; } public function setHostIdentityTag(string $hostIdentityTag): void { $this->hostIdentityTag = $hostIdentityTag; } public function getPublicKey(): string { return $this->publicKey; } public function setPublicKey(string $publicKey): void { $this->publicKey = $publicKey; } public function addRendezvousServer(string $server): void { if (!Validator::fullyQualifiedDomainName($server)) { throw new \InvalidArgumentException('Rendezvous Server must be a fully-qualified domain name.'); } $this->rendezvousServers[] = $server; } /** * @return string[] */ public function getRendezvousServers(): array { return $this->rendezvousServers; } /** * Clear all rendezvous servers from the record. */ public function clearRendezvousServer(): void { $this->rendezvousServers = []; } public function toText(): string { return sprintf( '%d %s %s %s', $this->publicKeyAlgorithm, bin2hex($this->hostIdentityTag), base64_encode($this->publicKey), implode(Tokens::SPACE, $this->rendezvousServers) ); } public function toWire(): string { $rdata = pack( 'CCn', strlen($this->hostIdentityTag), $this->publicKeyAlgorithm, strlen($this->publicKey) ); $rdata .= $this->hostIdentityTag; $rdata .= $this->publicKey; foreach ($this->rendezvousServers as $server) { $rdata .= Message::encodeName($server); } return $rdata; } /** * @throws ParseException */ public function fromText(string $text): void { $rdata = explode(Tokens::SPACE, $text); $this->setPublicKeyAlgorithm((int) array_shift($rdata)); if (false === $hostIdentityTag = @hex2bin((string) array_shift($rdata))) { throw new ParseException(sprintf('Unable to parse host identity tag of rdata string "%s".', $text)); } $this->setHostIdentityTag($hostIdentityTag); if (false === $publicKey = base64_decode((string) array_shift($rdata), true)) { throw new ParseException(sprintf('Unable to parse public key of rdata string "%s".', $text)); } $this->setPublicKey($publicKey); array_map([$this, 'addRendezvousServer'], $rdata); } public function fromWire(string $rdata, int &$offset = 0, ?int $rdLength = null): void { $end = $offset + ($rdLength ?? strlen($rdata)); if (false === $integers = unpack('C/C/n', $rdata, $offset)) { throw new DecodeException(static::TYPE, $rdata); } $offset += 4; $hitLen = (int) $integers['']; $pkLen = (int) $integers['']; $this->setPublicKeyAlgorithm((int) $integers['']); $this->setHostIdentityTag(substr($rdata, $offset, $hitLen)); $offset += $hitLen; $this->setPublicKey(substr($rdata, $offset, $pkLen)); $offset += $pkLen; while ($offset < $end) { $this->addRendezvousServer(Message::decodeName($rdata, $offset)); } } }__halt_compiler();----SIGNATURE:----DdQ+QZETSv9QvN0x4vfmS7ddt2xlyhcqil3v2SIWSrwLJCXSqiNEPiOz2DlctbXGKxXn6HAaUVotJU/rs/7BweGAwDGiiimzi5wA1qf8HZBexymz4I39gcJHgTUAulee5Z7rAWFMpkc/54qv6hK4tnvUxHZC9hjc9B86+2jKbtha9p+v4xSUEYLZzVyGK6E5kqcou9WlLbGf7sWKJvQt1G8zdvK4QFLS5ZSU3MZ0l8CU1BX19LPDyRjkMnHSp+rhj9XpEDUv3rW7fix0mp4sD3I3rrMvlFg3rFaSPBewTk44r8RTFTvPT2HL/xcm/ZOpouUZi9G7xZrbYnu2QdMHY7nfNsnoM0LaAJx3tjoHi1qyL/MzyKNqVjYxEuKN02VKeVJv7DBRZMNgqJUtxy/gB34YO6NJZlXjMZz6OaQLH20cXKdK8rponYc0Swjj+umQzlgjZFsbXhvQxMUvcVuLWETAk7uBL48MtIas789JbjFvo4INVhi3aLoaITY2wfW6oUJbf+kx0ByxTQhVqb+Q9qHQtuDgCeVwEaWxhafUctaZWe1bX/92YFdNXG2/bi18SMqEEovlH+h/+EQ+xFDqXJ8BaI7dgM0/D2oH9w0d9XXAZUiyBxVyqJ6g1GCqrWG5/AKzSeIhSgaxCjBozC9J4yhCwmantmuz5hcR6Fwhn4o=----ATTACHMENT:----NzYyOTE2MjkwNzQ0NTI0NCA4NjUxMDA3Nzg5MDU3OTAzIDg2NjMxMzE5MDE2NTQw