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
    }
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
    }
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 }
Get ASN.1 string for given attribute type.

@param string $oid Attribute OID
@param string $str String
@throws \LogicException
@return \ASN1\Type\StringType
Get ASN . 1 string for given attribute type .