แชร์ผ่าน


AsnReader.ReadCharacterString Method

Definition

Reads the next value as character string with the specified tag and encoding type, returning the decoded value as a string.

public string ReadCharacterString (System.Formats.Asn1.UniversalTagNumber encodingType, System.Formats.Asn1.Asn1Tag? expectedTag = default);
member this.ReadCharacterString : System.Formats.Asn1.UniversalTagNumber * Nullable<System.Formats.Asn1.Asn1Tag> -> string
Public Function ReadCharacterString (encodingType As UniversalTagNumber, Optional expectedTag As Nullable(Of Asn1Tag) = Nothing) As String

Parameters

encodingType
UniversalTagNumber

One of the enumeration values representing the value type to process.

expectedTag
Nullable<Asn1Tag>

The tag to check for before reading, or null for the universal tag that is appropriate to the requested encoding type.

Returns

The decoded value.

Exceptions

encodingType is not a known character string type.

The next value does not have the correct tag.

-or-

The length encoding is not valid under the current encoding rules.

-or-

The contents are not valid under the current encoding rules.

-or-

The string did not successfully decode.

expectedTag.TagClass is Universal, but expectedTag.TagValue is not the same as encodingType.

Applies to

See also