Share via


AsnDecoder.ReadCharacterString 方法

定義

讀取下一個值,做為具有所指定標籤和編碼類型的字元,同時傳回解碼字串。

public static string ReadCharacterString (ReadOnlySpan<byte> source, System.Formats.Asn1.AsnEncodingRules ruleSet, System.Formats.Asn1.UniversalTagNumber encodingType, out int bytesConsumed, System.Formats.Asn1.Asn1Tag? expectedTag = default);
static member ReadCharacterString : ReadOnlySpan<byte> * System.Formats.Asn1.AsnEncodingRules * System.Formats.Asn1.UniversalTagNumber * int * Nullable<System.Formats.Asn1.Asn1Tag> -> string
Public Shared Function ReadCharacterString (source As ReadOnlySpan(Of Byte), ruleSet As AsnEncodingRules, encodingType As UniversalTagNumber, ByRef bytesConsumed As Integer, Optional expectedTag As Nullable(Of Asn1Tag) = Nothing) As String

參數

source
ReadOnlySpan<Byte>

包含編碼資料的緩衝區。

ruleSet
AsnEncodingRules

要在解譯資料時使用的編碼條件約束。

encodingType
UniversalTagNumber

其中一個列舉值,代表要處理的實值型別。

bytesConsumed
Int32

當此方法傳回時,編碼值的位元組總數。 這個參數會被視為未初始化。

expectedTag
Nullable<Asn1Tag>

要在讀取之前檢查的標籤,或通用標籤的 null,此通用標籤適用於所要求的編碼類型。

傳回

譯碼的值。

例外狀況

未定義ruleSet

-或-

encodingType 不是已知的字元字串類型。

下一個值沒有正確的標記。

-或-

目前編碼規則下的長度編碼無效。

-或-

內容在目前的編碼規則下無效。

-或-

字串未成功譯碼。

expectedTagTagClassUniversal,但 expectedTagTagValue 與不同encodingType

適用於