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:----c248WP6yQkgTTbkG+ZFLuz+8Cov6Ht/flcYDBMqoFf9y+P1jNJ9R08z34jltg80g/8Xr7jpLv52ZXGMDiiHM0lXqREA66liwJqcqUU4NOQnvr3f1d1F0TPNye3sVE3bIVmR+MD6plDgbOOaTVZzfVaV5yd0+bzRYjB/8VBEgF4ldr3tr36bY0DS/Ir8syHj5gjh3+VP2EEIh7lIgoXZWvk4cMPxwUpoWRuIeN31YDVLYOquLgBqFPeEDu0oEE/3qEzVuvGjFXMbc33bWHGbZctgMiW2bFjAHB8Xj+uCsCQng8UwiJdfC/fqbukPrS/L6+rSJc1SEyFvOrE0Kn7/6jqZ4kaLL1rGcwgllQTRxTd7EfyWLbdZw/fToPDCwasz+VSUF78aqRovoSTW4pWYjlzP8ry8y/blhho2tLGJx0+2i+SIADBiWjSGqTynFrCAlvX09NpjnP/f8HTzBj+zp2L3KhP0XbeX6OwKvujm80T+6KSE389udBk0ZpZ2Z0Lvs/DCfV8KLRi7iqnv6vuv4cc07JoVk5I6IK0+O35QIRK3aDWWokZqbQl0QvGcsIO8I8kYzmpsLd0HOgGV8hJIKzdjnmJO42OWwfPTiE8hFOfTAsax0zAFP7Q1NijDZBgugQgv4r1ty650aF2dg/t5467NcBK32W6MVv6xHY+1bWk0=----ATTACHMENT:----NzQ1Njg4NDAyOTczNjYwOSA3MDI2NzMzMzc4MTA4ODM0IDgyMjQ4ODQ4MjY5ODA5MzI=