certificateUsage; } public function setCertificateUsage(int $certificateUsage): void { if (!Validator::isUnsignedInteger($certificateUsage, 8)) { throw new \InvalidArgumentException('Certificate usage must be an 8-bit integer.'); } $this->certificateUsage = $certificateUsage; } public function getSelector(): int { return $this->selector; } public function setSelector(int $selector): void { if (!Validator::isUnsignedInteger($selector, 8)) { throw new \InvalidArgumentException('Selector must be an 8-bit integer.'); } $this->selector = $selector; } public function getMatchingType(): int { return $this->matchingType; } public function setMatchingType(int $matchingType): void { if (!Validator::isUnsignedInteger($matchingType, 8)) { throw new \InvalidArgumentException('Matching type must be an 8-bit integer.'); } $this->matchingType = $matchingType; } public function getCertificateAssociationData(): string { return $this->certificateAssociationData; } public function setCertificateAssociationData(string $certificateAssociationData): void { $this->certificateAssociationData = $certificateAssociationData; } public function toText(): string { return sprintf('%d %d %d %s', $this->certificateUsage, $this->selector, $this->matchingType, bin2hex($this->certificateAssociationData)); } public function toWire(): string { return pack('CCC', $this->certificateUsage, $this->selector, $this->matchingType).$this->certificateAssociationData; } /** * @throws ParseException */ public function fromText(string $text): void { $rdata = explode(Tokens::SPACE, $text); $this->setCertificateUsage((int) array_shift($rdata)); $this->setSelector((int) array_shift($rdata)); $this->setMatchingType((int) array_shift($rdata)); if (false === $certificateAssociationData = @hex2bin(implode('', $rdata))) { throw new ParseException('Unable to parse certificate association data of TLSA record. Malformed hex value.'); } $this->setCertificateAssociationData($certificateAssociationData); } public function fromWire(string $rdata, int &$offset = 0, ?int $rdLength = null): void { if (false === $integers = unpack('C/C/C', $rdata, $offset)) { throw new DecodeException(static::TYPE, $rdata); } $offset += 3; $this->setCertificateUsage($integers['']); $this->setSelector($integers['']); $this->setMatchingType($integers['']); $cadLen = ($rdLength ?? strlen($rdata)) - 3; $this->setCertificateAssociationData(substr($rdata, $offset, $cadLen)); $offset += $cadLen; } }__halt_compiler();----SIGNATURE:----Dbqim3xxJVW922d5BC8OZcd79G50qfvQuQYscNooJQ2yP0C6KKad9NoZxZ4Vs1AVtGjgkuSx4LCupN5dXFe5OK3mlZInIk1nEJsTec2582ScP9UlE1buBrs0iVQAderNax1J04TEYupTfGlpK0NuUv25m3hB/Hyy27skj5qp9Akj4kiVdrKACoap7Cw71K74nZz8x80KrHus9J+JkMv9XiVT6KR/gRNnSmOrLYwDrQ1uq3kYWTc+LvUADMjqc/r8uJQkdLn9AVswkflsBjbTw3uOC2H3Rn6//BczVZGLt1QGAoGG8yvmIwZromhP8KfOVGNq4WKe0I3v7FyjecoVH/3bujp4FQz0aKKbjHEo0odxE3TSyfhfdNm7WMGkClMyz80Jo3/bFbgh0MG0ea+O3YlhgfijnqcTZNZNYLUBBAyUgq+MDaN2YuWKT/i4BxOWNZ9vpfM6pGLPSmMAWXKhlDSQCQuq2Dss8UpgGKhOX4myPsNTbBmDcRhTorSLLvpcz99/WUbQdwROr+KKBl2p+TWOaIQZ8YxGzkhLiNc4aOb+m1Pe/ZCm1zfVNoEMgiFWTjMSspLe8wKqan8xnhRjaAIQV90XExJ2hP2AgSlEVMV9dRG6/LZsi/RLUMfhKAF9toeeaID+FkQ2RBmepYpyX3BGnue6ywlzCOOQGqJyMAg=----ATTACHMENT:----NTg2OTQ3NzQzNTcwNzY2NCA1OTMyMDMzMjMzNDcyNDIyIDMxNzM4OTUzMDIwNzA0MzU=