Libraries
ASN.1 Source Code
 previous   up   next 

Types
asn1TagType
Tag type used by ASN.1/BER data elements.
asn1DataElement
ASN.1/BER data element.

asn1TagType

const type: asn1TagType

Tag type used by ASN.1/BER data elements.


asn1DataElement

const type: asn1DataElement

ASN.1/BER data element. This type is used for reading ASN.1/BER data.


Function Summary
asn1DataElement
getAsn1DataElement (in string: stri, inout integer: pos)
Read the header of an ASN.1/BER data element, from stri.
string
getData (in string: stri, inout integer: pos, in asn1DataElement: dataElement)
Read the data of a given ASN.1/BER dataElement, from stri.
void
skipData (inout integer: pos, in asn1DataElement: dataElement)
Skip the data of a given ASN.1/BER dataElement, from stri.
string
genAsn1Element (in asn1TagType: tagType, in string: data)
Create an ASN.1/BER data element from tagType and data.
string
genAsn1Integer (in string: data)
Create an integer ASN.1/BER data element from data.
string
genAsn1String (in string: data)
Create a string ASN.1/BER data element from data.
string
genAsn1Sequence (in string: data)
Create a sequence ASN.1/BER data element from data.
string
genAsn1Set (in string: data)
Create a set ASN.1/BER data element from data.
string
genExplicitAsn1Tag (in integer: tagNumber, in string: data)
Create an explicit ASN.1/BER tag with tagNumber from data.

Function Detail

getAsn1DataElement

const func asn1DataElement: getAsn1DataElement (in string: stri, inout integer: pos)

Read the header of an ASN.1/BER data element, from stri. It is assumed that the data element header starts at position pos. The function advances pos beyond the header to the actual data. The actual data can be read afterwards, with the function getData.

dataElem := getAsn1DataElement(asn1, pos);
if dataElem.tagType = tagObjectIdentifier then
  contentType := getData(asn1, pos, dataElem);
  ...
Returns:
the header of an ASN.1/BER data element.

getData

const func string: getData (in string: stri, inout integer: pos, in asn1DataElement: dataElement)

Read the data of a given ASN.1/BER dataElement, from stri. It is assumed that the actual data starts at position pos. The function advances pos beyond the dataElement data.

Returns:
the data of the ASN.1/BER dataElement.

skipData

const proc: skipData (inout integer: pos, in asn1DataElement: dataElement)

Skip the data of a given ASN.1/BER dataElement, from stri. It is assumed that the actual data starts at position pos. The function advances pos beyond the dataElement data.


genAsn1Element

const func string: genAsn1Element (in asn1TagType: tagType, in string: data)

Create an ASN.1/BER data element from tagType and data.

Returns:
the ASN.1/BER data element as string.

genAsn1Integer

const func string: genAsn1Integer (in string: data)

Create an integer ASN.1/BER data element from data. The tag type of the generated data element is tagInteger.

genAsn1Integer(bytes(123, SIGNED, BE))  returns  "\2;\1;{"
Returns:
the integer ASN.1/BER data element as string.

genAsn1String

const func string: genAsn1String (in string: data)

Create a string ASN.1/BER data element from data. Depending on data the tag type of the generated data element is tagPrintableString, tagVisibleString or tagUTF8String.

genAsn1String("abc")  returns  "\19;\3;abc"
genAsn1String("#%&")  returns  "\26;\3;#%&"
genAsn1String("€")    returns  "\f\3;â\130;¬"
Returns:
the string ASN.1/BER data element as string.

genAsn1Sequence

const func string: genAsn1Sequence (in string: data)

Create a sequence ASN.1/BER data element from data. The tag type of the generated data element is tagSequence.

Returns:
the sequence ASN.1/BER data element as string.

genAsn1Set

const func string: genAsn1Set (in string: data)

Create a set ASN.1/BER data element from data. The tag type of the generated data element is tagSet.

Returns:
the set ASN.1/BER data element as string.

genExplicitAsn1Tag

const func string: genExplicitAsn1Tag (in integer: tagNumber, in string: data)

Create an explicit ASN.1/BER tag with tagNumber from data.

Returns:
the explicit ASN.1/BER tag as string.


 previous   up   next