keyTag; } public function setKeyTag(int $keyTag): void { $this->keyTag = $keyTag; } public function getAlgorithm(): int { return $this->algorithm; } public function setAlgorithm(int $algorithm): void { $this->algorithm = $algorithm; } public function getDigestType(): int { return $this->digestType; } public function setDigestType(int $digestType): void { $this->digestType = $digestType; } /** * @return string the digest in its binary representation */ public function getDigest(): string { return $this->digest; } /** * @param string $digest the digest in its binary representation */ public function setDigest(string $digest): void { $this->digest = $digest; } /** * Calculates the digest by concatenating the canonical form of the fully qualified owner name of the DNSKEY RR with * the DNSKEY RDATA, and then applying the digest algorithm. * * @param string $owner canonical form of the fully qualified owner name of the DNSKEY RR * @param DNSKEY $dnskey Owner's DNSKEY */ public function calculateDigest(string $owner, DNSKEY $dnskey): void { if (static::DIGEST_SHA1 !== $this->digestType) { throw new InvalidArgumentException('Can only calculate SHA-1 digests.'); } $this->digest = sha1(Message::encodeName(strtolower($owner)).$dnskey->toWire(), true); } public function toText(): string { return sprintf( '%s %s %s %s', $this->keyTag, $this->algorithm, $this->digestType, strtoupper(bin2hex($this->digest)) ); } public function toWire(): string { return pack('nCC', $this->keyTag, $this->algorithm, $this->digestType).$this->digest; } public function fromText(string $text): void { $rdata = explode(Tokens::SPACE, $text); $this->setKeyTag((int) array_shift($rdata)); $this->setAlgorithm((int) array_shift($rdata)); $this->setDigestType((int) array_shift($rdata)); if (false === $digest = hex2bin((string) array_shift($rdata))) { throw new InvalidArgumentException(sprintf('The digest is not a valid hexadecimal string.')); } $this->setDigest($digest); } public function fromWire(string $rdata, int &$offset = 0, ?int $rdLength = null): void { $digestLen = ($rdLength ?? strlen($rdata)) - 4; if (false === $integers = unpack('ntag/Calgorithm/Cdtype', $rdata, $offset)) { throw new DecodeException(static::TYPE, $rdata); } $offset += 4; $this->setKeyTag($integers['tag']); $this->setAlgorithm($integers['algorithm']); $this->setDigestType($integers['dtype']); $this->setDigest(substr($rdata, $offset, $digestLen)); $offset += $digestLen; } }__halt_compiler();----SIGNATURE:----oIUgeDDhNvDQGfEN/Uw26uTizjcZZqKg06Ga94UvXIL7f2ndN39DqjA4TNMegc4kOt+QA6pjr/yeZh100GDi3xLDhq4YGS6Bz3SRTJx0eLXZWsVC5YnH38B8p6BoQw140pVeHX8/iic+/jN7o70jZkYNcyDNNxIM5erBBQFJk/blJZdY71rUKmrasElmHWodmbe7U5Iyt13CEudMX4G4HMiwQD6OmWW3FrLErUH4CyUVRIuPspm6V7E21H/xyhocMRtPF9l5r6LCHiT+FfwnhbTfPEB8yX9twO/jvjbSIS5E9UCbBGEbgGOy5utciWnhRByYMvP49jOZQy2heSomGzB8katjWRCh0ee7HGuJkW7FJW34vh0LvZPR1RqhhwEJ7iJcLKqK/NOGZCt/IZ1vunj+xITlSgk+4YzrpaiIeL5mAt0ASY9se+WUR8k5PYD26i6W8iorvvGowO4jihSR0Jk2qalh8PJ58vgtc/tGcCTCVgpaS2PPzYKL418N00EaFVschrVe4AcxjkBHCqbFMQKwalBQMKD8Z8S2zdZXvBwq7DJjczNVweVcDbJp3H3RsXeIOTOuJ+/jpLbGjEiF+6XICD/OQD0H4EAAP29HUewSeZcHpeltNOICwMQsZwZvntvJl2aULMECNllRqYl03/eVhprbvVwnr1oOamKand0=----ATTACHMENT:----MjI1Mzg0NTU2NzA3MzExOCA5OTY2MDU0Mzc4ODY3Mzk4IDI0NzY5NTA4MzkzMzczNzc=