ASN1C C# Runtime Library  7.4
Static Public Member Functions | List of all members
Asn1Value Class Reference

Static Public Member Functions

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

Detailed Description

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

Member Function Documentation

◆ ParseString() [1/2]

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
dataThe ASN.1 value specification text
numbitsHolder to receive number of bits in string
Returns
byte array value

References IntHolder.mValue, and Diag.Prtln().

Referenced by Asn1BitString.Asn1BitString(), and Asn1OctetString.Asn1OctetString().

◆ ParseString() [2/2]

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

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

Parameters
dataThe ASN.1 value specification text
Returns
byte array value

◆ StringEqualsBytes() [1/2]

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
valueThe ASN.1 value specification text
dataArray of bytes to compare string with.

Referenced by Asn1OctetString.Equals(), and Asn1BitString.Equals().

◆ StringEqualsBytes() [2/2]

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
valueThe ASN.1 value specification text
dataArray of bytes to compare string with.
nbitsNumber of bits in data to compare.