Asn1Value Class Reference

List of all members.

Static Public Member Functions

static byte[] ParseString (System.String data)
static byte[] ParseString (System.String data, IntHolder numbits)
static bool StringEqualsBytes (String value, byte[] data, int nbits)
static bool StringEqualsBytes (String value, byte[] data)

Detailed Description

This class provides methods for parsing and formatting text in ASN.1 value notation.


Member Function Documentation

static byte [] ParseString ( System.String  data  )  [static]

This overloaded version of the ParseString method sets the numbits holder value to null.

Parameters:
data The ASN.1 value specification text
Returns:
byte array value
static byte [] ParseString ( System.String  data,
IntHolder  numbits 
) [static]

This static method parses the given ASN.1 value text (either a binary or hex data string) and returns the value in a binary byte array. The number of bits is also returned.

Examples of valid value formats are as follows:

Binary string: '11010010111001'B

Hex string: '0fa56920014abc'H

Char string: 'abcdefg'

Parameters:
data The ASN.1 value specification text
numbits Holder to receive number of bits in string
Returns:
byte array value
static bool StringEqualsBytes ( String  value,
byte[]  data,
int  nbits 
) [static]

This static method parses the given ASN.1 value text (either a binary or hex data string) and compares it with the given byte array. This version of the method allows you to specify a number of bits to compare, which is useful when dealing with bit strings, as opposed to octet strings.

Examples of valid value formats are as follows: Binary string: '11010010111001'B Hex string: '0fa56920014abc'H Char string: 'abcdefg' /p>

Parameters:
value The ASN.1 value specification text
data Array of bytes to compare string with.
nbits Number of bits in data to compare.
static bool StringEqualsBytes ( String  value,
byte[]  data 
) [static]

This static method parses the given ASN.1 value text (either a binary or hex data string) and compares it with the given byte array. Examples of valid value formats are as follows: Binary string: '11010010111001'B Hex string: '0fa56920014abc'H Char string: 'abcdefg'

Parameters:
value The ASN.1 value specification text
data Array of bytes to compare string with.