public static function asn1StringForType(string $oid, string $str): StringType
    {
        if (!array_key_exists($oid, self::MAP_ATTR_TO_STR_TYPE)) {
            return new UTF8String($str);
        }
        switch (self::MAP_ATTR_TO_STR_TYPE[$oid]) {
            case Element::TYPE_PRINTABLE_STRING:
                return new PrintableString($str);
            // @codeCoverageIgnoreStart
            default:
                // only reachable during development
                throw new \LogicException();
        }
        // @codeCoverageIgnoreEnd
    }