typeCovered; } /** * @param string $typeCovered */ public function setTypeCovered(string $typeCovered): void { $this->typeCovered = $typeCovered; } /** * @return int */ public function getAlgorithm(): int { return $this->algorithm; } /** * @param int $algorithm */ public function setAlgorithm(int $algorithm): void { $this->algorithm = $algorithm; } /** * @return int */ public function getLabels(): int { return $this->labels; } /** * @param int $labels */ public function setLabels(int $labels): void { $this->labels = $labels; } /** * @return int */ public function getOriginalTtl(): int { return $this->originalTtl; } /** * @param int $originalTtl */ public function setOriginalTtl(int $originalTtl): void { $this->originalTtl = $originalTtl; } /** * @return \DateTime */ public function getSignatureExpiration(): \DateTime { return $this->signatureExpiration; } /** * @param \DateTime $signatureExpiration */ public function setSignatureExpiration(\DateTime $signatureExpiration): void { $this->signatureExpiration = $signatureExpiration; } /** * @return \DateTime */ public function getSignatureInception(): \DateTime { return $this->signatureInception; } /** * @param \DateTime $signatureInception */ public function setSignatureInception(\DateTime $signatureInception): void { $this->signatureInception = $signatureInception; } /** * @return int */ public function getKeyTag(): int { return $this->keyTag; } /** * @param int $keyTag */ public function setKeyTag(int $keyTag): void { $this->keyTag = $keyTag; } /** * @return string */ public function getSignersName(): string { return $this->signersName; } /** * @param string $signersName */ public function setSignersName(string $signersName): void { $this->signersName = $signersName; } /** * @return string */ public function getSignature(): string { return $this->signature; } /** * @param string $signature */ public function setSignature(string $signature): void { $this->signature = $signature; } /** * {@inheritdoc} */ public function toText(): string { return sprintf( '%s %s %s %s %s %s %s %s %s', $this->typeCovered, $this->algorithm, $this->labels, $this->originalTtl, $this->signatureExpiration->format(self::TIME_FORMAT), $this->signatureInception->format(self::TIME_FORMAT), $this->keyTag, $this->signersName, $this->signature ); } /** * @return string * * @throws UnsupportedTypeException */ public function toWire(): string { $wire = pack('nCCNNNn', Types::getTypeCode($this->typeCovered), $this->algorithm, $this->labels, $this->originalTtl, (int) $this->signatureExpiration->format('U'), (int) $this->signatureInception->format('U'), $this->keyTag ); $wire .= RdataTrait::encodeName($this->signersName); $wire .= $this->signature; return $wire; } /** * {@inheritdoc} * * @return RRSIG */ public static function fromText(string $text): RdataInterface { $rdata = explode(Tokens::SPACE, $text); $rrsig = new static(); $rrsig->setTypeCovered((string) array_shift($rdata)); $rrsig->setAlgorithm((int) array_shift($rdata)); $rrsig->setLabels((int) array_shift($rdata)); $rrsig->setOriginalTtl((int) array_shift($rdata)); $sigExpiration = (string) array_shift($rdata); $sigInception = (string) array_shift($rdata); $rrsig->setKeyTag((int) array_shift($rdata)); $rrsig->setSignersName((string) array_shift($rdata)); $rrsig->setSignature(implode('', $rdata)); $rrsig->setSignatureExpiration(self::makeDateTime($sigExpiration)); $rrsig->setSignatureInception(self::makeDateTime($sigInception)); return $rrsig; } /** * {@inheritdoc} * * @return RRSIG * * @throws UnsupportedTypeException */ public static function fromWire(string $rdata, int &$offset = 0, ?int $rdLength = null): RdataInterface { $rdLength = $rdLength ?? strlen($rdata); $end = $offset + $rdLength; $values = unpack('n/C/C/N/N/N/n', $rdata, $offset); $offset += 18; $signersName = RdataTrait::decodeName($rdata, $offset); $sigLen = $end - $offset; $signature = substr($rdata, $offset, $sigLen); $offset += $sigLen; $rrsig = new static(); $rrsig->setTypeCovered(Types::getName($values[''])); $rrsig->setAlgorithm($values['']); $rrsig->setLabels($values['']); $rrsig->setOriginalTtl($values['']); $rrsig->setKeyTag($values['']); $rrsig->setSignersName($signersName); $rrsig->setSignature($signature); $rrsig->setSignatureExpiration(self::makeDateTime((string) $values[''])); $rrsig->setSignatureInception(self::makeDateTime((string) $values[''])); return $rrsig; } /** * @param string $timeString * * @return \DateTime */ private static function makeDateTime(string $timeString): \DateTime { $timeFormat = (14 === strlen($timeString)) ? self::TIME_FORMAT : 'U'; if (false === $dateTime = \DateTime::createFromFormat($timeFormat, $timeString)) { throw new \InvalidArgumentException(sprintf('Unable to create \DateTime object from date "%s".', $timeString)); } return $dateTime; } } __halt_compiler();----SIGNATURE:----XiFv238rfiL9V8Jb91dzwSDtOuLlw6N7GlA3P2+WivfdQBM5YX5OO5ZOwGtrvxsKd01ZeSQzroSPGrg4vvv3hMSB7PKpoC19uSzxfMthG+FYP+oL6GCiZsCL29AwrYxCTs3PfhMMS8YNWSsccu9+56n64Yk0FiGXtRIlfz5+A3iPqoJHqtNbcUnWzGgLVujanYgVzKEP+O1wd+gt42YF4OEK+m3wPuaGZW3v7kner/rOOo4G6MksWyPNgKewQp5UA9hFoA3orKtPSLd0P1sXxMnNaMJ+hpjBhAh0SME9vM+Lt2pLmm31ti12UvhN1eTcbQCNZGWuC/B/5IZXefLfCIIcVbe8BMnyVcQm8+p2h1ILznt6XRexywk3JkeEXCLtpPsL6NdZCCGqhjbQ7/MWascMDg7ryh59ZNFdz7+6yLnAHu/rSf8np1Vn1Beflno5q0y83aLo0TZb2bzdV1ccI00AQctQLxMZ6w445Fc1xJA5hl1S0lY3CYkb02qfka5Tf1lKlltaGf5MdQ6ROsaI7N5yhwg3xfH4IeRp0Y/fgAqbJIeFt3LQ4CdtVb6e4Zk7JMTHbKTtLwaK6LKeTz6x0AQkESqR1hoCM/5Mm2U7lGbLs6uPGYLRAfXczzLoBEPyyZ5YFIb5EqsZDl9tVQNeJsFT4Dyyo5KOs54kADJEL4M=----ATTACHMENT:----MzMwMTg3NTQ0MzcwODk0OSA1MzUxODA5MzE0MjMzMDMyIDY2NTQ3NDAzNDIwNTE3NTI=