Assembly: CardWerk.SmartCard (in CardWerk.SmartCard.dll)
Public Shared Function Parse( _
ByVal vbData As Byte(), _
ByRef nOffset As Integer, _
ByRef nLength As Integer, _
ByVal nEncoding As CardDataObjectEncoding _
) As CardDataObject
This language is not supported or no code example is available.
public static CardDataObject Parse(
byte[] vbData,
ref int nOffset,
ref int nLength,
CardDataObjectEncoding nEncoding
)
This language is not supported or no code example is available.
public:
static CardDataObject^ Parse(
array< Byte >^ vbData,
int& nOffset,
int& nLength,
CardDataObjectEncoding nEncoding
)
This language is not supported or no code example is available.
public static function Parse(
vbData : byte[],
nOffset : int,
nLength : int,
nEncoding : CardDataObjectEncoding
) : CardDataObject;
This language is not supported or no code example is available.
Parameters
- vbData
-
Type: byte[]
Provides the raw binary data to be parsed. Must not be null.
- nOffset
-
Type: int
[in,out] Offset in data array where parsing shall begin. This is updated to the offset of the first byte after the parsed data object on return. Thus it is possible to repeatedly call this method in order to parse a sequence of data objects.
- nLength
-
Type: int
[in,out] Maximum number of bytes to consume from the given data array. If the parsed data object is bigger than the remaining length, then a System.FormatException will be thrown. On return this parameter is reduced by the amount of bytes actually consumed. The initial must not be gibber than 65535 or be negative.
- nEncoding
-
Type: CardDataObjectEncoding
The expected type of TLV encoding. Through this parameter the caller can specify whether the data is BER-TLV or SIMPLE-TLV encoded.
Return Value
Type: CardDataObject
Returns the parsed TLV data object inside a newly created CardDataObject instance. All data is copied from the given vbData array into newly created arrays owned by the created CardDataObject instance.
If the nLength was zero, or the data only contains empty filler bytes, then null is returned. In this case the returned final nLength will be zero, too.
Exception type | Condition |
---|---|
Thrown when one or more arguments are outside the required range. |
|
Thrown when one or more required arguments are null. |
|
Thrown when the format of the ? is incorrect. |
If the data is BER-TLV encoded and the parsed tag indicates a constructed data object, then it will be recursively parsed until all contained data objects have also been parsed. Thus effectively returning a tree of CardDataObject instances.
Any empty filler bytes with the value 0x00 or 0xFF that are preceeding the tag will be skipped. Inside constructed data objects any empty filler bytes before, between or after the actual BER-TLV data objects are skipped, too.
If the parsed data is an invalid TLV encoding, or is an incomplete TLV data object, then a System.FormatException will be thrown.