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:----d3QbN80L0E5DzqNNiLIkI+PweWzaYQbSebDhubPX8JRqk3tprvzIHphuhH4jxyuXVmvZRu+uV6okwfqH8BeRdb6fBgKK+XK2JUl4+KDtIw5MDXpWUrku2jvn5vTvH8YwmW72f9NRR9StLqHLnlTDODdntypgGxSPS6pPSlu6w2o+WOXmHF+BLIkjamXOnqR603yJDm8CRiMaGIBUXE3czCVvIUTSNrSsx26PfEG4jL5f+RE4KKwux76ULp6+sed7it2m67EtnvAlXr1Kc662weJvyboNv1i/MNb5fmHmUIllpUbv6LfWvYhcFbZ+Kl5qSp305SnnvzU2mYrn50Tw42XG4PwPdowc850l8J3Udfxr5OnBS93JBAZs6g+5QVy5Rp0rCVllml+BYtUpJA0Lj1tWHzUdbKAj5vkfP0PyKowA9bGgpwIcVEyKJYUujNfQws542cNi4iC02dH1rYhqeOCWJ2n0keAAhuWsQQR1g4PFJGIt4fVQ5CVc7tPjULbfWFSrKrUVPVjm4cOnVSA4fAUXvm3sEQWoLYijYgA5FwUshRg6OA9M2QAxxQsDZWNxoKJP7W6TSXdAAeVeBEl+FzHxd4aHYZthkIgj/1m0kSF/utzDuI4i/nt5Wm4nFoUGgmzgdzIi8gc6nsMe4gnlpl9NUtN44mLae/hcFpgRlmI=----ATTACHMENT:----MTg2NjE5Njg1NjAzMDk1MCA0NzA1MTY0NTI1MDE4NzkwIDg0MTQ4MDA5NjQ2OTA3MTE=