<?php

declare(strict_types=1);

namespace Logliy\SpomkyLabs\Pki\ASN1\Type\Primitive;

use Logliy\SpomkyLabs\Pki\ASN1\Type\PrimitiveString;
use Logliy\SpomkyLabs\Pki\ASN1\Type\UniversalClass;

/**
 * Implements *T61String* type.
 */
final class T61String extends PrimitiveString
{
    use UniversalClass;

    private function __construct(string $string)
    {
        parent::__construct(self::TYPE_T61_STRING, $string);
    }

    public static function create(string $string): self
    {
        return new self($string);
    }

    protected function validateString(string $string): bool
    {
        // allow everything since there's literally
        // thousands of allowed characters (16 bit composed characters)
        return true;
    }
}
