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:----A+St8Ye6XADvbWTK3iPdEuMImA6sTkQlgUAKQOl4AT8ImQE5L1FwpPrSpMqUGitmGMu36vvxDJoOQkU11oOvGCWX5MxgTcBU1cNuOlza31tdBHYBYwG2rI7sU0+dZzeJ9ToPONcac45WWvCuezue7J3BfPz/nH9orVX0IFX2YbPWQ0tHSYLBrCppQ8XY9jSUDNLGfoNCLpi1Hm4hKvKYOTlfD+miZxINOJrFF/jaehJdxo26hsn0pdtkVrQq4P6PR6bQv5iUW3mVVPWa9t9sR18Qo/3A2N+P7zV39I9kCPGHTFArBCcE9HMglqNw9GTXYx3fRzp1w3rdn6DAuqL0KA/ozotRMW/I+xSVwUp671pxwz4aHi4Qmax/RgI98guW1w47ZHnbJ23wk6++0TA+bZ9tWrFYM4yNtTeXjach6OGMp4V7g2MHxM1ToD6J0f6jRFkC7kFJeN4r3SB9DXX5HoUn2caoPGVzKtbZYkzd4kQ7ZtS0Iq0vNbE+eXJaKKVMG26F+4yE8AcxGExB4EQDlZtS5BflZcg+nuQOx71Nj+s2CPjc5d7VnHcuGbaEh8yrHd7YICCBKUeQAWbK2ocPkEz5pXvaoPdgidTqrwgH8DGaJeh3ZmOYY/u+ndp0AFeIxciBdSkSGUDHo3AcL18jhWve7SywDVTQBQjhh3dvMRg=----ATTACHMENT:----NzEzNjg3MjU5ODk1OTQyMiAzNTc3MjE2MTcyNzExNDY3IDcwMDkwNDIwNjI2Njc0ODk=