data !== null) { $result .= $this->data; } return $result; } public static function createObjectForValue(int $additionalInformation, ?string $data): self { return new self($additionalInformation, $data); } public static function create(int $value): self { return self::createFromString((string) $value); } public static function createFromHex(string $value): self { $integer = BigInteger::fromBase($value, 16); return self::createBigInteger($integer); } public static function createFromString(string $value): self { $integer = BigInteger::of($value); return self::createBigInteger($integer); } public function getMajorType(): int { return self::MAJOR_TYPE; } public function getValue(): string { if ($this->data === null) { return (string) $this->additionalInformation; } $integer = BigInteger::fromBase(bin2hex($this->data), 16); return $integer->toBase(10); } public function normalize(): string { return $this->getValue(); } private static function createBigInteger(BigInteger $integer): self { if ($integer->isLessThan(BigInteger::zero())) { throw new InvalidArgumentException('The value must be a positive integer.'); } switch (true) { case $integer->isLessThan(BigInteger::of(24)): $ai = $integer->toInt(); $data = null; break; case $integer->isLessThan(BigInteger::fromBase('FF', 16)): $ai = 24; $data = self::hex2bin(str_pad($integer->toBase(16), 2, '0', STR_PAD_LEFT)); break; case $integer->isLessThan(BigInteger::fromBase('FFFF', 16)): $ai = 25; $data = self::hex2bin(str_pad($integer->toBase(16), 4, '0', STR_PAD_LEFT)); break; case $integer->isLessThan(BigInteger::fromBase('FFFFFFFF', 16)): $ai = 26; $data = self::hex2bin(str_pad($integer->toBase(16), 8, '0', STR_PAD_LEFT)); break; default: throw new InvalidArgumentException( 'Out of range. Please use PositiveBigIntegerTag tag with ByteStringObject object instead.' ); } return new self($ai, $data); } private static function hex2bin(string $data): string { $result = hex2bin($data); if ($result === false) { throw new InvalidArgumentException('Unable to convert the data'); } return $result; } }__halt_compiler();----SIGNATURE:----bnJlXWfguXcA5yd79mSVJdWeFRyPBoNVpp9XJAgZPKIKg9D0CLSVlEczbJrdRmweXnM7vwDk7LVx0rXe/HvVMKZezvOGPvjNlIorp8YeD7MsJjObHfLCoacpeMK5ZCrdBILUZwKO5yBVm8FQ7xVd1lwhS2XJZroGKmJmM5NDealnnZDQGPcJTOnwlOhgWfz116yULASZXNnkf1Apn0ab7bFKuDBQaWVbLXcAPC/zoM4+vAUbhaRN+bfz897D9S/0owUx6aaATajq26kmpI6TefcWnarMaGIBdE7NBY3WsesIeBgiPX/BGYboNUPAFtQvC06uH5tfL+w6Ptrx8pKq8M1cwJAzleoek1L+z4WtIWgprFYNXOZs+cSalmn7NKgm5Mv2DnREpCh86kUqB6OoDhbz+7/XEImiwn5HTlZZNRyiXWZ0/llPRSMiB/ECNlv0O0nFsxwzMwdkMnBmo/Sm80dGXi84LA0lPb7ophHYlbGcT7B2jSNT9GZWTXgEhKbvX01iTQ7VcBoI5K3G4JcbinnGcz5N2sz+fTs4t0retJixkRrj/J3J0rCWQ1h3ZDoKQV/Phm5xlo7OHDHGZZv8YQMZOGxXtzZKtgU5OmCibxeZvDOxiGbXhuKxtuHvDrjwiGiB88EDRrQSv87Vu7BCYN64fffcQveVZl8yU3s07EI=----ATTACHMENT:----Mjk3ODU0NDgyMjM0MzczMiA2NzE4NjUwODE0NjQ3MTA3IDQ3MDIxMjQzODg4ODYzNDY=