ASN.1-XML encode/decode functions.
Functions | |
int | rtAsn1XmlpDecObjId (OSCTXT *pctxt, ASN1OBJID *pvalue) |
This function decodes the contents of an ASN.1 OBJECT IDENTIFIER type. | |
int | rtAsn1XmlpDecUnivStr (OSCTXT *pctxt, const OS32BITCHAR **ppdata, OSUINT32 *pnchars) |
This function decodes the contents of an ASN.1 UNIVERSAL string type. | |
int | rtAsn1XmlEncGenTime (OSCTXT *pctxt, const char *value, const OSUTF8CHAR *elemName, const OSUTF8CHAR *nsPrefix) |
This function encodes a variable of the ASN.1 GeneralizedTime type. | |
int | rtAsn1XmlEncUTCTime (OSCTXT *pctxt, const char *value, const OSUTF8CHAR *elemName, const OSUTF8CHAR *nsPrefix) |
This function encodes a variable of the ASN.1 UTCTime type. | |
int | rtAsn1XmlEncObjId (OSCTXT *pctxt, const ASN1OBJID *pvalue, const OSUTF8CHAR *elemName, const OSUTF8CHAR *nsPrefix) |
This function encodes a variable of the ASN.1 OBJECT IDENTIFIER type. | |
int | rtAsn1XmlEncRelOID (OSCTXT *pctxt, const ASN1OBJID *pvalue, const OSUTF8CHAR *elemName, const OSUTF8CHAR *nsPrefix) |
This function encodes a variable of the ASN.1 RELATIVE-OID type. | |
int | rtAsn1XmlEncOpenType (OSCTXT *pctxt, const OSOCTET *data, OSUINT32 nocts, const OSUTF8CHAR *elemName, const OSUTF8CHAR *nsPrefix) |
This function encodes a variable of the ASN.1 open type. | |
int | rtAsn1XmlEncOpenTypeExt (OSCTXT *pctxt, OSRTDList *pElemList) |
This function encodes an ASN.1 open type extension. | |
int | rtAsn1XmlEncUnivStr (OSCTXT *pctxt, const OS32BITCHAR *value, OSUINT32 nchars, const OSUTF8CHAR *elemName, const OSUTF8CHAR *nsPrefix) |
This function encodes a variable of the ASN.1 UNIVERSAL string type. | |
int | rtAsn1XmlFmtAttrStr (OSCTXT *pctxt, const OSUTF8CHAR *name, const OSUTF8CHAR *value, OSUTF8CHAR **pAttrStr) |
This function formats a name-value XML pair into a name="value" attribute string. | |
int | rtAsn1XmlParseAttrStr (OSCTXT *pctxt, const OSUTF8CHAR *pAttrStr, OSUTF8NVP *pNVPair) |
This function parses an XML name-value pair from an attribute string. | |
int | rtAsn1XmlAddAnyAttr (OSCTXT *pctxt, const OSUTF8CHAR *name, const OSUTF8CHAR *value, OSRTDList *plist) |
This function formats an attribute string and adds it to the attribute list. | |
int | rtAsn1XmlpDecDynBitStr (OSCTXT *pctxt, ASN1DynBitStr *pvalue) |
This function decodes a bit string value. | |
int | rtXmlpDecListOfASN1DynBitStr (OSCTXT *pctxt, OSRTDList *plist) |
This function decodes a list of space-separated bit strings and returns each bit string as a separate item on the given list. | |
int | rtAsn1XmlpDecRelOID (OSCTXT *pctxt, ASN1OBJID *pvalue) |
This function decodes the contents of an ASN.1 RELATIVE-OID type. |
Function Documentation
int rtAsn1XmlAddAnyAttr | ( | OSCTXT * | pctxt, | |
const OSUTF8CHAR * | name, | |||
const OSUTF8CHAR * | value, | |||
OSRTDList * | plist | |||
) |
This function formats an attribute string and adds it to the attribute list.
- Parameters:
-
pctxt A pointer to a context structure. This provides a storage area for the function to store all working variables that must be maintained between function calls. name The name of the new attribute. value The value of the new attribute. plist The attribute list.
int rtAsn1XmlEncGenTime | ( | OSCTXT * | pctxt, | |
const char * | value, | |||
const OSUTF8CHAR * | elemName, | |||
const OSUTF8CHAR * | nsPrefix | |||
) |
This function encodes a variable of the ASN.1 GeneralizedTime type.
It performs conversion from ASN.1 time format into the XML dateTime format.
- Parameters:
-
pctxt A pointer to a context structure. This provides a storage area for the function to store all working variables that must be maintained between function calls. value A pointer to a null-terminated C character string to be encoded. It should contain UTCTime in ASN.1 format. elemName XML element name. A name must be provided. If an empty string is passed (""), no element tag is added to the encoded value. nsPrefix XML namespace prefix. If not null, will be prepended to elemName to form a qualified name.
- Returns:
- Completion status of operation:
- 0 (0) = success,
- negative return value is error.
int rtAsn1XmlEncObjId | ( | OSCTXT * | pctxt, | |
const ASN1OBJID * | pvalue, | |||
const OSUTF8CHAR * | elemName, | |||
const OSUTF8CHAR * | nsPrefix | |||
) |
This function encodes a variable of the ASN.1 OBJECT IDENTIFIER type.
- Parameters:
-
pctxt A pointer to a context structure. This provides a storage area for the function to store all working variables that must be maintained between function calls. pvalue A pointer to an object identifier structure. This structure contains an integer to hold the number of subidentifers in the object and an array to hold the subidentifier values. elemName XML element name. A name must be provided. If an empty string is passed (""), no element tag is added to the encoded value. nsPrefix XML namespace prefix. If not null, will be prepended to elemName to form a qualified name.
- Returns:
- Completion status of operation:
- 0 (0) = success,
- negative return value is error.
int rtAsn1XmlEncOpenType | ( | OSCTXT * | pctxt, | |
const OSOCTET * | data, | |||
OSUINT32 | nocts, | |||
const OSUTF8CHAR * | elemName, | |||
const OSUTF8CHAR * | nsPrefix | |||
) |
This function encodes a variable of the ASN.1 open type.
It copies the data as it exists in the structure to the encode buffer or stream.
- Parameters:
-
pctxt A pointer to a context structure. This provides a storage area for the function to store all working variables that must be maintained between function calls. data A pointer to a buffer containing the open type data. nocts Number of bytes in the data buffer to encode. elemName XML element name. A name must be provided. If an empty string is passed (""), no element tag is added to the encoded value. nsPrefix XML namespace prefix. If not null, will be prepended to elemName to form a qualified name.
- Returns:
- Completion status of operation:
- 0 (0) = success,
- negative return value is error.
int rtAsn1XmlEncOpenTypeExt | ( | OSCTXT * | pctxt, | |
OSRTDList * | pElemList | |||
) |
This function encodes an ASN.1 open type extension.
This occurs in a SEQUENCE or SET type when a ... is present. The type is represented as a list of open type structures.
- Parameters:
-
pctxt A pointer to a context structure. This provides a storage area for the function to store all working variables that must be maintained between function calls. pElemList Linked list of ASN.1 open type structures.
- Returns:
- Completion status of operation:
- 0 (0) = success,
- negative return value is error.
int rtAsn1XmlEncRelOID | ( | OSCTXT * | pctxt, | |
const ASN1OBJID * | pvalue, | |||
const OSUTF8CHAR * | elemName, | |||
const OSUTF8CHAR * | nsPrefix | |||
) |
This function encodes a variable of the ASN.1 RELATIVE-OID type.
- Parameters:
-
pctxt A pointer to a context structure. This provides a storage area for the function to store all working variables that must be maintained between function calls. pvalue A pointer to an object identifier structure. This structure contains an integer to hold the number of subidentifers in the object and an array to hold the subidentifier values. elemName XML element name. A name must be provided. If an empty string is passed (""), no element tag is added to the encoded value. nsPrefix XML namespace prefix. If not null, will be prepended to elemName to form a qualified name.
- Returns:
- Completion status of operation:
- 0 (0) = success,
- negative return value is error.
int rtAsn1XmlEncUnivStr | ( | OSCTXT * | pctxt, | |
const OS32BITCHAR * | value, | |||
OSUINT32 | nchars, | |||
const OSUTF8CHAR * | elemName, | |||
const OSUTF8CHAR * | nsPrefix | |||
) |
This function encodes a variable of the ASN.1 UNIVERSAL string type.
- Parameters:
-
pctxt A pointer to a context structure. This provides a storage area for the function to store all working variables that must be maintained between function calls. value Array of universal characters to be encoded. Each character is represented as a 32-bit integer. nchars Number of characters to encode. elemName XML element name. A name must be provided. If an empty string is passed (""), no element tag is added to the encoded value. nsPrefix XML namespace prefix. If not null, will be prepended to elemName to form a qualified name.
- Returns:
- Completion status of operation:
- 0 (0) = success,
- negative return value is error.
int rtAsn1XmlEncUTCTime | ( | OSCTXT * | pctxt, | |
const char * | value, | |||
const OSUTF8CHAR * | elemName, | |||
const OSUTF8CHAR * | nsPrefix | |||
) |
This function encodes a variable of the ASN.1 UTCTime type.
It performs conversion from ASN.1 time format into the XML dateTime format.
- Parameters:
-
pctxt A pointer to a context structure. This provides a storage area for the function to store all working variables that must be maintained between function calls. value A pointer to a null-terminated C character string to be encoded. It should contain UTCTime in ASN.1 format. elemName XML element name. A name must be provided. If an empty string is passed (""), no element tag is added to the encoded value. nsPrefix XML namespace prefix. If not null, will be prepended to elemName to form a qualified name.
- Returns:
- Completion status of operation:
- 0 (0) = success,
- negative return value is error.
int rtAsn1XmlFmtAttrStr | ( | OSCTXT * | pctxt, | |
const OSUTF8CHAR * | name, | |||
const OSUTF8CHAR * | value, | |||
OSUTF8CHAR ** | pAttrStr | |||
) |
This function formats a name-value XML pair into a name="value" attribute string.
- Parameters:
-
pctxt A pointer to a context structure. This provides a storage area for the function to store all working variables that must be maintained between function calls. name A pointer to an XML element name. A name must be provided. value A pointer to the corresponding element value. pAttrStr The resulting name="value" string.
- Returns:
- Completion status of operation:
- 0 (0) = success,
- negative return value is error.
int rtAsn1XmlParseAttrStr | ( | OSCTXT * | pctxt, | |
const OSUTF8CHAR * | pAttrStr, | |||
OSUTF8NVP * | pNVPair | |||
) |
This function parses an XML name-value pair from an attribute string.
- Parameters:
-
pctxt A pointer to a context structure. This provides a storage area for the function to store all working variables that must be maintained between function calls. pAttrStr The name-value string to be parsed. pNVPair A pointer to an XML name-value pair structure filled in by invoking this method.
- Returns:
- Completion status of operation:
- 0 (0) = success,
- negative return value is error.
int rtAsn1XmlpDecDynBitStr | ( | OSCTXT * | pctxt, | |
ASN1DynBitStr * | pvalue | |||
) |
This function decodes a bit string value.
The string consists of a series of '1' and '0' characters. This is the dynamic version in which memory is allocated for the returned binary string variable. Bits are stored from MSB to LSB order.
- Parameters:
-
pctxt Pointer to context block structure. pvalue Pointer to a variable to receive the decoded boolean value.
- Returns:
- Completion status of operation:
- 0 = success,
- negative return value is error.
int rtAsn1XmlpDecObjId | ( | OSCTXT * | pctxt, | |
ASN1OBJID * | pvalue | |||
) |
This function decodes the contents of an ASN.1 OBJECT IDENTIFIER type.
Input is expected to be a string of OSUTF8CHAR characters returned by an XML pull parser.
- Parameters:
-
pctxt Pointer to context block structure. pvalue Pointer to ASN.1 object identifier value to receive decoded result.
- Returns:
- Completion status of operation:
- 0 = success,
- negative return value is error.
int rtAsn1XmlpDecRelOID | ( | OSCTXT * | pctxt, | |
ASN1OBJID * | pvalue | |||
) |
This function decodes the contents of an ASN.1 RELATIVE-OID type.
Input is expected to be a string of OSUTF8CHAR characters returned by an XML pull parser.
- Parameters:
-
pctxt Pointer to context block structure. pvalue Pointer to ASN.1 object identifier value to receive decoded result.
- Returns:
- Completion status of operation:
- 0 = success,
- negative return value is error.
int rtAsn1XmlpDecUnivStr | ( | OSCTXT * | pctxt, | |
const OS32BITCHAR ** | ppdata, | |||
OSUINT32 * | pnchars | |||
) |
This function decodes the contents of an ASN.1 UNIVERSAL string type.
Input is expected to be a string of OSUTF8CHAR characters returned by an XML pull parser.
- Parameters:
-
pctxt Pointer to context block structure. ppdata Pointer to 32-bit character string value to receive decoded result. pnchars Pointer to length value to recieve decoded length in characters.
- Returns:
- Completion status of operation:
- 0 = success,
- negative return value is error.
int rtXmlpDecListOfASN1DynBitStr | ( | OSCTXT * | pctxt, | |
OSRTDList * | plist | |||
) |
This function decodes a list of space-separated bit strings and returns each bit string as a separate item on the given list.
The string consists of a series of '1' and '0' characters. Memory is allocated for the list nodes and token values using the rtx memory management functions. Bits are stored from MSB to LSB order.
- Parameters:
-
pctxt A pointer to a context structure. This provides a storage area for the function to store all working variables that must be maintained between function calls. plist A pointer to a linked list structure to which the parsed bit string values will be added.
- Returns:
- Completion status of operation:
- 0 = success,
- negative return value is error.