Home > Support > Documentation

PER C Decode Functions.
[PER Runtime Library Functions.]


Detailed Description

PER runtime library decode functions handle the decoding of the primitive ASN.1 data types and length variables. Calls to these functions are assembled in the C source code generated by the ASN1C complier to decode complex ASN.1 structures. These functions are also directly callable from within a user's application program if the need to decode a primitive item exists.

The procedure to decode a primitive data item is as follows:

  1. Call the pu_newContext or pu_initContext function to specify the address of the buffer containing the encoded ASN.1 data to be decoded and whether the data is aligned, or unaligned.
  2. Call the specific decode function to decode the value.


Defines

#define pd_UnconsUnsigned(pctxt, pvalue)   pd_SemiConsUnsigned(pctxt, pvalue, 0U)
#define pd_UnconsUInt64(pctxt, pvalue)   pd_SemiConsUInt64(pctxt, pvalue, 0)

Functions

int pd_bit (OSCTXT *pctxt, OSBOOL *pvalue)
int pd_bits (OSCTXT *pctxt, OSUINT32 *pvalue, OSUINT32 nbits)
int pd_BigInteger (OSCTXT *pctxt, const char **ppvalue)
int pd_BitString (OSCTXT *pctxt, OSUINT32 *numbits_p, OSOCTET *buffer, OSUINT32 bufsiz)
int pd_BMPString (OSCTXT *pctxt, ASN1BMPString *pvalue, Asn116BitCharSet *permCharSet)
int pd_UniversalString (OSCTXT *pctxt, ASN1UniversalString *pvalue, Asn132BitCharSet *permCharSet)
int pd_byte_align (OSCTXT *pctxt)
int pd_ChoiceOpenTypeExt (OSCTXT *pctxt, const OSOCTET **object_p2, OSUINT32 *pnumocts)
int pd_ConsInteger (OSCTXT *pctxt, OSINT32 *pvalue, OSINT32 lower, OSINT32 upper)
int pd_ConsInt8 (OSCTXT *pctxt, OSINT8 *pvalue, OSINT32 lower, OSINT32 upper)
int pd_ConsInt16 (OSCTXT *pctxt, OSINT16 *pvalue, OSINT32 lower, OSINT32 upper)
int pd_ConsInt64 (OSCTXT *pctxt, OSINT64 *pvalue, OSINT64 lower, OSINT64 upper)
int pd_ConsUnsigned (OSCTXT *pctxt, OSUINT32 *pvalue, OSUINT32 lower, OSUINT32 upper)
int pd_ConsUInt8 (OSCTXT *pctxt, OSUINT8 *pvalue, OSUINT32 lower, OSUINT32 upper)
int pd_ConsUInt16 (OSCTXT *pctxt, OSUINT16 *pvalue, OSUINT32 lower, OSUINT32 upper)
int pd_ConsUInt64 (OSCTXT *pctxt, OSUINT64 *pvalue, OSUINT64 lower, OSUINT64 upper)
int pd_ConsWholeNumber (OSCTXT *pctxt, OSUINT32 *padjusted_value, OSUINT32 range_value)
int pd_ConsWholeNumber64 (OSCTXT *pctxt, OSUINT64 *padjusted_value, OSUINT64 range_value)
int pd_ConstrainedString (OSCTXT *pctxt, const char **string, Asn1CharSet *pCharSet)
int pd_ConstrainedStringEx (OSCTXT *pctxt, const char **string, const char *charSet, OSUINT32 abits, OSUINT32 ubits, OSUINT32 canSetBits)
int pd_16BitConstrainedString (OSCTXT *pctxt, Asn116BitCharString *pString, Asn116BitCharSet *pCharSet)
int pd_32BitConstrainedString (OSCTXT *pctxt, Asn132BitCharString *pString, Asn132BitCharSet *pCharSet)
int pd_DynBitString (OSCTXT *pctxt, ASN1DynBitStr *pBitStr)
int pd_DynOctetString (OSCTXT *pctxt, ASN1DynOctStr *pOctStr)
int pd_GetComponentLength (OSCTXT *pctxt, OSUINT32 itemBits)
int pd_Length (OSCTXT *pctxt, OSUINT32 *pvalue)
int pd_moveBitCursor (OSCTXT *pctxt, int bitOffset)
int pd_ObjectIdentifier (OSCTXT *pctxt, ASN1OBJID *pvalue)
int pd_oid64 (OSCTXT *pctxt, ASN1OID64 *pvalue)
int pd_RelativeOID (OSCTXT *pctxt, ASN1OBJID *pvalue)
int pd_OctetString (OSCTXT *pctxt, OSUINT32 *pnumocts, OSOCTET *buffer, OSUINT32 bufsiz)
int pd_OpenType (OSCTXT *pctxt, const OSOCTET **object_p2, OSUINT32 *pnumocts)
int pd_OpenTypeExt (OSCTXT *pctxt, const OSOCTET **object_p2, OSUINT32 *pnumocts)
int pd_Real (OSCTXT *pctxt, OSREAL *pvalue)
int pd_SmallNonNegWholeNumber (OSCTXT *pctxt, OSUINT32 *pvalue)
int pd_SemiConsInteger (OSCTXT *pctxt, OSINT32 *pvalue, OSINT32 lower)
int pd_SemiConsUnsigned (OSCTXT *pctxt, OSUINT32 *pvalue, OSUINT32 lower)
int pd_SemiConsInt64 (OSCTXT *pctxt, OSINT64 *pvalue, OSINT64 lower)
int pd_SemiConsUInt64 (OSCTXT *pctxt, OSUINT64 *pvalue, OSUINT64 lower)
int pd_UnconsInteger (OSCTXT *pctxt, OSINT32 *pvalue)
int pd_UnconsInt64 (OSCTXT *pctxt, OSINT64 *pvalue)
int pd_VarWidthCharString (OSCTXT *pctxt, const char **pvalue)
int pd_Real10 (OSCTXT *pctxt, const char **ppvalue)

Define Documentation

#define pd_UnconsUInt64 pctxt,
pvalue   )     pd_SemiConsUInt64(pctxt, pvalue, 0)
 

This function will decode an unconstrained unsigned 64-bit integer.

Parameters:
pctxt Pointer to context block structure.
pvalue Pointer to unsigned 64-bit integer variable to receive decoded value.
Returns:
Completion status of operation:
  • 0 (0) = success,
  • negative return value is error.

#define pd_UnconsUnsigned pctxt,
pvalue   )     pd_SemiConsUnsigned(pctxt, pvalue, 0U)
 

This function will decode an unconstrained unsigned integer.

Parameters:
pctxt Pointer to context block structure.
pvalue Pointer to unsigned integer variable to receive decoded value.
Returns:
Completion status of operation:
  • 0 (0) = success,
  • negative return value is error.

Function Documentation

int pd_16BitConstrainedString OSCTXT *  pctxt,
Asn116BitCharString *  pString,
Asn116BitCharSet *  pCharSet
 

This function will encode a constrained ASN.1 character string. This function is normally not called directly but rather is called from Useful Type Character String encode functions that deal with 16-bit strings. The only function that does not release is the pe_BMPString function.

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.
pString Character string to be encoded. The structure includes a count field containing the number of characters to encode and an array of unsigned short integers to hold the 16-bit characters to be encoded.
pCharSet Pointer to the constraining character set. This contains an array containing all valid characters in the set as well as the aligned and unaligned bit counts required to encode the characters.
Returns:
Completion status of operation:
  • 0 (0) = success,
  • negative return value is error.

int pd_32BitConstrainedString OSCTXT *  pctxt,
Asn132BitCharString *  pString,
Asn132BitCharSet *  pCharSet
 

This function will encode a constrained ASN.1 character string. This function is normally not called directly but rather is called from Useful Type Character String encode functions that deal with 32-bit strings. The only function that does not release is the pe_UniversalString function.

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.
pString Character string to be encoded. The structure includes a count field containing the number of characters to encode and an array of unsigned short integers to hold the 32-bit characters to be encoded.
pCharSet Pointer to the constraining character set. This contains an array containing all valid characters in the set as well as the aligned and unaligned bit counts required to encode the characters.
Returns:
Completion status of operation:
  • 0 (0) = success,
  • negative return value is error.

int pd_BigInteger OSCTXT *  pctxt,
const char **  ppvalue
 

This function decodes a variable of the ASN.1 INTEGER type. In this case, the integer is assumed to be of a larger size than can fit in a C or C++ long type (normally 32 or 64 bits). For example, parameters used to calculate security values are typically larger than these sizes. These variables are stored in character string constant variables. They are represented as hexadecimal strings starting with "0x" prefix. If it is necessary to convert a hexadecimal string to another radix, then use the rtxBigIntSetStr / rtxBigIntToString functions.

Parameters:
pctxt Pointer to context block structure.
ppvalue Pointer to a character pointer variable to receive the decoded unsigned value. Dynamic memory is allocated for the variable using the rtxMemAlloc function. The decoded variable is represented as a decimal string starting with no prefix.
Returns:
Completion status of operation:
  • 0 (0) = success,
  • negative return value is error.

int pd_bit OSCTXT *  pctxt,
OSBOOL *  pvalue
 

This function will decode a single bit a place the result in an ASN.1 BOOLEAN type variable.

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 the BOOLEAN value to receive the decoded result.
Returns:
Completion status of operation:
  • 0 (0) = success,
  • negative return value is error.

int pd_bits OSCTXT *  pctxt,
OSUINT32 *  pvalue,
OSUINT32  nbits
 

This function will decode a series of multiple bits and place the results in an unsigned integer variable.

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 unsigned integer variable to receive the decoded result.
nbits The number of bits to decode.
Returns:
Completion status of operation:
  • 0 (0) = success,
  • negative return value is error.

int pd_BitString OSCTXT *  pctxt,
OSUINT32 *  numbits_p,
OSOCTET *  buffer,
OSUINT32  bufsiz
 

This function will decode a value of the ASN.1 bit string type whose maximum size is is known in advance. The ASN1C complier generates a call to this function to decode bit string productions or elements that contain a size constraint.

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.
numbits_p Pointer to an unsigned integer variable to receive decoded number of bits.
buffer Pointer to a fixed-size or pre-allocated array of bufsiz octets to receive a decoded bit string.
bufsiz Length (in octets) of the buffer to receive the decoded bit string.
Returns:
Completion status of operation:
  • 0 (0) = success,
  • negative return value is error.

int pd_BMPString OSCTXT *  pctxt,
ASN1BMPString *  pvalue,
Asn116BitCharSet *  permCharSet
 

This function will decode a variable of the ASN.1 BMP character string. This differs from the decode routines for the character strings previously described in that the BMP string type is based on 16-bit characters. A 16-bit character string is modeled using an array of unsigned short integers.

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 Pointer to character string structure to receive the decoded result. The structure includes a count field containing the number of characters and an array of unsigned short integers to hold the 16-bit character values.
permCharSet A pointer to the constraining character set. This contains an array containing all valid characters in the set as well as the aligned and unaligned bit counts required to encode the characters.
Returns:
Completion status of operation:
  • 0 (0) = success,
  • negative return value is error.

int pd_byte_align OSCTXT *  pctxt  ) 
 

This function will position the decode bit cursor on the next byte boundary.

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.
Returns:
Completion status of operation:
  • 0 (0) = success,
  • negative return value is error.

int pd_ChoiceOpenTypeExt OSCTXT *  pctxt,
const OSOCTET **  object_p2,
OSUINT32 *  pnumocts
 

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.
object_p2 A pointer to an open type variable to receive the decoded data.
pnumocts A pointer to an unsigned buffer of bufsiz octets to receive decoded data.

int pd_ConsInt16 OSCTXT *  pctxt,
OSINT16 *  pvalue,
OSINT32  lower,
OSINT32  upper
 

This function will decode a 16-bit integer constrained either by a value or value range constraint.

Parameters:
pctxt Pointer to context block structure.
pvalue Pointer to 16-bit integer variable to receive decoded value.
lower Lower range value.
upper Upper range value.
Returns:
Completion status of operation:
  • 0 (0) = success,
  • negative return value is error.

int pd_ConsInt64 OSCTXT *  pctxt,
OSINT64 *  pvalue,
OSINT64  lower,
OSINT64  upper
 

This function will decode a 64-bit integer constrained either by a value or value range constraint.

Parameters:
pctxt Pointer to context block structure.
pvalue Pointer to 64-bit integer variable to receive decoded value.
lower Lower range value, represented as 64-bit integer.
upper Upper range value, represented as 64-bit integer.
Returns:
Completion status of operation:
  • 0 (0) = success,
  • negative return value is error.

int pd_ConsInt8 OSCTXT *  pctxt,
OSINT8 *  pvalue,
OSINT32  lower,
OSINT32  upper
 

This function will decode an 8-bit integer constrained either by a value or value range constraint.

Parameters:
pctxt Pointer to context block structure.
pvalue Pointer to 8-bit integer variable to receive decoded value.
lower Lower range value.
upper Upper range value.
Returns:
Completion status of operation:
  • 0 (0) = success,
  • negative return value is error.

int pd_ConsInteger OSCTXT *  pctxt,
OSINT32 *  pvalue,
OSINT32  lower,
OSINT32  upper
 

This function will decode an integer constrained either by a value or value range constraint.

Parameters:
pctxt Pointer to context block structure.
pvalue Pointer to integer variable to receive decoded value.
lower Lower range value.
upper Upper range value.
Returns:
Completion status of operation:
  • 0 (0) = success,
  • negative return value is error.

int pd_ConstrainedString OSCTXT *  pctxt,
const char **  string,
Asn1CharSet *  pCharSet
 

This function decodes a constrained string value. This is a deprecated version of the function provided for backward compatibility.

Parameters:
pctxt Pointer to context block structure.
string Pointer to const char* to receive decoded string. Memory will be allocated for this variable using internal memory management functions.
pCharSet Pointer to a character set descriptor structure. This contains an array containing all valid characters in the set as well as the aligned and unaligned bit counts required to encode the characters.
Returns:
Completion status of operation:
  • 0 (0) = success,
  • negative return value is error.

int pd_ConstrainedStringEx OSCTXT *  pctxt,
const char **  string,
const char *  charSet,
OSUINT32  abits,
OSUINT32  ubits,
OSUINT32  canSetBits
 

This function decodes a constrained string value. This version of the function allows all of the required permitted alphabet constraint parameters to be passed in as arguments.

Parameters:
pctxt Pointer to context block structure.
string Pointer to const char* to receive decoded string. Memory will be allocated for this variable using internal memory management functions.
charSet String containing permitted alphabet character set. Can be null if no character set was specified.
abits Number of bits in a character set character (aligned).
ubits Number of bits in a character set character (unaligned).
canSetBits Number of bits in a character from the canonical set representing this string.
Returns:
Completion status of operation:
  • 0 (0) = success,
  • negative return value is error.

int pd_ConsUInt16 OSCTXT *  pctxt,
OSUINT16 *  pvalue,
OSUINT32  lower,
OSUINT32  upper
 

This function will decode a 16-bit unsigned integer constrained either by a value or value range constraint.

Parameters:
pctxt Pointer to context block structure.
pvalue Pointer to 16-bit unsigned integer variable to receive decoded value.
lower Lower range value.
upper Upper range value.
Returns:
Completion status of operation:
  • 0 (0) = success,
  • negative return value is error.

int pd_ConsUInt64 OSCTXT *  pctxt,
OSUINT64 *  pvalue,
OSUINT64  lower,
OSUINT64  upper
 

This function will decode a 64-bit unsigned integer constrained either by a value or value range constraint.

Parameters:
pctxt Pointer to context block structure.
pvalue Pointer to 64-bit unsigned integer variable to receive decoded value.
lower Lower range value.
upper Upper range value.
Returns:
Completion status of operation:
  • 0 (0) = success,
  • negative return value is error.

int pd_ConsUInt8 OSCTXT *  pctxt,
OSUINT8 *  pvalue,
OSUINT32  lower,
OSUINT32  upper
 

This function will decode an 8-bit unsigned integer constrained either by a value or value range constraint.

Parameters:
pctxt Pointer to context block structure.
pvalue Pointer to 8-bit unsigned integer variable to receive decoded value.
lower Lower range value.
upper Upper range value.
Returns:
Completion status of operation:
  • 0 (0) = success,
  • negative return value is error.

int pd_ConsUnsigned OSCTXT *  pctxt,
OSUINT32 *  pvalue,
OSUINT32  lower,
OSUINT32  upper
 

This function will decode an unsigned integer constrained either by a value or value range constraint.

Parameters:
pctxt Pointer to context block structure.
pvalue Pointer to unsigned integer variable to receive decoded value.
lower Lower range value.
upper Upper range value.
Returns:
Completion status of operation:
  • 0 (0) = success,
  • negative return value is error.

int pd_ConsWholeNumber OSCTXT *  pctxt,
OSUINT32 *  padjusted_value,
OSUINT32  range_value
 

This function decodes a constrained whole number as specified in Section 10.5 of the X.691 standard.

Parameters:
pctxt Pointer to context block structure.
padjusted_value Pointer to unsigned adjusted integer value to receive decoded result. To get the final value, this value is added to the lower boundary of the range.
range_value Unsigned integer value specifying the total size of the range. This is obtained by subtracting the lower range value from the upper range value.
Returns:
Completion status of operation:
  • 0 (0) = success,
  • negative return value is error.

int pd_ConsWholeNumber64 OSCTXT *  pctxt,
OSUINT64 *  padjusted_value,
OSUINT64  range_value
 

This function decodes a constrained whole number as specified in Section 10.5 of the X.691 standard, represented as 64-bit integer.

Parameters:
pctxt Pointer to context block structure.
padjusted_value Pointer to 64-bit unsigned adjusted integer value to receive decoded result. To get the final value, this value is added to the lower boundary of the range.
range_value Unsigned 64-bit integer value specifying the total size of the range. This is obtained by subtracting the lower range value from the upper range value.
Returns:
Completion status of operation:
  • 0 (0) = success,
  • negative return value is error.

int pd_DynBitString OSCTXT *  pctxt,
ASN1DynBitStr *  pBitStr
 

This function will decode a variable of thr ASN.1 BIT STRING type. This function allocates dynamic memory t store the decoded result. The ASN1C complier generates a call to this function to decode an unconstrained bit string production or element.

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.
pBitStr Pointer to a dynamic bit string structure to receive the decoded result. This structure contains a field to hold the number of decoded bits and a pointer to an octet string to hold the decoded data. Memory is allocated by the decoder using the rtxMemAlloc function. This memory is tracked within the context and released when the pu_freeContext function is invoked.
Returns:
Completion status of operation:
  • 0 (0) = success,
  • negative return value is error.

int pd_DynOctetString OSCTXT *  pctxt,
ASN1DynOctStr *  pOctStr
 

This function will decode a value of the ASN.1 octet string type whose maximum size is known in advance. The ASN1C complier generates a call to this function to decode octet string productions or elements that contain a size constraint.

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.
pOctStr A pointer to a dynamic octet string to receive the decoded result.
Returns:
Completion status of operation:
  • 0 (0) = success,
  • negative return value is error.

int pd_GetComponentLength OSCTXT *  pctxt,
OSUINT32  itemBits
 

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.
itemBits The size of the specific entity.
Returns:
Completion status of operation:
  • 0 (0) = success,
  • negative return value is error.

int pd_Length OSCTXT *  pctxt,
OSUINT32 *  pvalue
 

This function will decode a length determinant value.

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 unsigned integer variable to receive the decoded length value.
Returns:
Completion status of operation:
  • 0 (0) = success,
  • negative return value is error.

int pd_moveBitCursor OSCTXT *  pctxt,
int  bitOffset
 

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.
bitOffset The bit offset inside the message buffer.

int pd_ObjectIdentifier OSCTXT *  pctxt,
ASN1OBJID *  pvalue
 

This function decodes a value of the ASN.1 object identifier type.

Parameters:
pctxt Pointer to context block structure.
pvalue Pointer to value to receive decoded result. The ASN1OBJID structure contains an integer to hold the number of subidentifiers and an array to hold the subidentifier values.
Returns:
Completion status of operation:
  • 0 (0) = success,
  • negative return value is error.

int pd_OctetString OSCTXT *  pctxt,
OSUINT32 *  pnumocts,
OSOCTET *  buffer,
OSUINT32  bufsiz
 

This function will decode a value of the ASN.1 octet string type whose maximun size is known in advance. The ASN1C compiler generates a call to this function to decode octet string productions or elements that contain a size constraint.

Parameters:
pctxt 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.
pnumocts A pointer to an unsigned buffer of bufsiz octets to receive decoded data.
buffer A pointer to a pre-allocated buffer of size octets to receive the decoded data.
bufsiz The size of the buffer to receive the decoded result.
Returns:
Completion status of operation:
  • 0 (0) = success,
  • negative return value is error.

int pd_oid64 OSCTXT *  pctxt,
ASN1OID64 *  pvalue
 

This function decodes a value of the ASN.1 object identifier type using 64-bit subidentifiers.

Parameters:
pctxt Pointer to context block structure.
pvalue Pointer to value to receive decoded result. The ASN1OID64 structure contains an integer to hold the number of subidentifiers and an array of 64-bit unsigned integers to hold the subidentifier values.
Returns:
Completion status of operation:
  • 0 (0) = success,
  • negative return value is error.

int pd_OpenType OSCTXT *  pctxt,
const OSOCTET **  object_p2,
OSUINT32 *  pnumocts
 

This function will decode an ASN.1 open type. This used to be the ASN.1 ANY type, but now is used in a variety of applications requiring an encoding that can be interpreted by a decoder without prior knowledge of the type of the variable.

Parameters:
pctxt 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.
pnumocts A pointer to an unsigned buffer of bufsiz octets to receive decoded data.
object_p2 A pointer to an open type variable to receive the decoded data.
Returns:
Completion status of operation:
  • 0 (0) = success,
  • negative return value is error.

int pd_OpenTypeExt OSCTXT *  pctxt,
const OSOCTET **  object_p2,
OSUINT32 *  pnumocts
 

This function will decode an ASN.1 open type extension. These are extra fields in a version-2 message that may be present after the ... extension marker. An open type structure (extElem1) is added to a message structure that contains an extension marker but no extension elements. The pd_OpenTypeExt function will populate this structure with the complete extension information (optional bit or choice index, length and data). A subsequent call to pe_OpenTypeExt will cause the saved extension fields to be included in a newly encoded message of the given type.

Parameters:
pctxt 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.
object_p2 A pointer to an open type variable to receive the decoded data.
pnumocts A pointer to an unsigned buffer of bufsiz octets to receive decoded data.
Returns:
Completion status of operation:
  • 0 (0) = success,
  • negative return value is error.

int pd_Real OSCTXT *  pctxt,
OSREAL *  pvalue
 

This function will decode a value of the binary encoded ASN.1 real type. This function provides support for the plus-infinity special real values.

Parameters:
pctxt Pointer to a context structure. This provides a storage area for the function to store all workings variables that must be maintained between function calls.
pvalue Pointer to an real variable to receive decoded value.
Returns:
Completion status of operation:
  • 0 (0) = success,
  • negative return value is error.

int pd_Real10 OSCTXT *  pctxt,
const char **  ppvalue
 

This function will decode a value of the decimal encoded ASN.1 real type.

Parameters:
pctxt Pointer to a context structure. This provides a storage area for the function to store all workings variables that must be maintained between function calls.
ppvalue Pointer to a character pointer variable to receive the decoded result. Dynamic memory is allocated for the variable using the rtxMemAlloc function.
Returns:
Completion status of operation:
  • 0 (0) = success,
  • negative return value is error.

int pd_RelativeOID OSCTXT *  pctxt,
ASN1OBJID *  pvalue
 

This function decodes a value of the ASN.1 RELATIVE-OID type.

Parameters:
pctxt Pointer to context block structure.
pvalue Pointer to value to receive decoded result. The ASN1OBJID structure contains an integer to hold the number of subidentifiers and an array to hold the subidentifier values.
Returns:
Completion status of operation:
  • 0 (0) = success,
  • negative return value is error.

int pd_SemiConsInt64 OSCTXT *  pctxt,
OSINT64 *  pvalue,
OSINT64  lower
 

This function will decode a semi-constrained 64-bit integer.

Parameters:
pctxt Pointer to context block structure.
pvalue Pointer to 64-bit integer variable to receive decoded value.
lower Lower range value, represented as signed 64-bit integer.
Returns:
Completion status of operation:
  • 0 (0) = success,
  • negative return value is error.

int pd_SemiConsInteger OSCTXT *  pctxt,
OSINT32 *  pvalue,
OSINT32  lower
 

This function will decode a semi-constrained integer.

Parameters:
pctxt Pointer to context block structure.
pvalue Pointer to integer variable to receive decoded value.
lower Lower range value, represented as signed integer.
Returns:
Completion status of operation:
  • 0 (0) = success,
  • negative return value is error.

int pd_SemiConsUInt64 OSCTXT *  pctxt,
OSUINT64 *  pvalue,
OSUINT64  lower
 

This function will decode a semi-constrained unsigned 64-bit integer.

Parameters:
pctxt Pointer to context block structure.
pvalue Pointer to unsigned 64-bit integer variable to receive decoded value.
lower Lower range value, represented as unsigned 64-bit integer.
Returns:
Completion status of operation:
  • 0 (0) = success,
  • negative return value is error.

int pd_SemiConsUnsigned OSCTXT *  pctxt,
OSUINT32 *  pvalue,
OSUINT32  lower
 

This function will decode a semi-constrained unsigned integer.

Parameters:
pctxt Pointer to context block structure.
pvalue Pointer to unsigned integer variable to receive decoded value.
lower Lower range value, represented as unsigned integer.
Returns:
Completion status of operation:
  • 0 (0) = success,
  • negative return value is error.

int pd_SmallNonNegWholeNumber OSCTXT *  pctxt,
OSUINT32 *  pvalue
 

This function will decode a small non-negative whole number as specified in Section 10.6 of the X.691 standard. This is a number that is expected to be small, but whose size is potentially unlimited due to the presence of an extension maker.

Parameters:
pctxt Pointer to a context structure. This provides a storage area for the function to store all workings variables that must be maintained between function calls.
pvalue Pointer to an unsigned integer value to receive decoded results.
Returns:
Completion status of operation:
  • 0 (0) = success,
  • negative return value is error.

int pd_UnconsInt64 OSCTXT *  pctxt,
OSINT64 *  pvalue
 

This function will decode an unconstrained 64-bit integer.

Parameters:
pctxt Pointer to context block structure.
pvalue Pointer to 64-bit integer variable to receive decoded value.
Returns:
Completion status of operation:
  • 0 (0) = success,
  • negative return value is error.

int pd_UnconsInteger OSCTXT *  pctxt,
OSINT32 *  pvalue
 

This function will decode an unconstrained integer.

Parameters:
pctxt Pointer to context block structure.
pvalue Pointer to integer variable to receive decoded value.
Returns:
Completion status of operation:
  • 0 (0) = success,
  • negative return value is error.

int pd_UniversalString OSCTXT *  pctxt,
ASN1UniversalString *  pvalue,
Asn132BitCharSet *  permCharSet
 

This function will decode a variable of the ASN.1 32-bit character string. This differs from the decode routines for the character strings previously described because the universal string type is based on 32-bit characters. A 32-bit character string is modeled using an array of unsigned integers.

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 Pointer to character string structure to receive the decoded result. The structure includes a count field containing the number of characters and an array of unsigned short integers to hold the 32-bit character values.
permCharSet A pointer to the constraining character set. This contains an array containing all valid characters in the set as well as the aligned and unaligned bit counts required to encode the characters.
Returns:
Completion status of operation:
  • 0 (0) = success,
  • negative return value is error.

int pd_VarWidthCharString OSCTXT *  pctxt,
const char **  pvalue
 

This function will decode a variable of the ASN.1 character string.

Parameters:
pctxt Pointer to context block structure.
ppvalue Pointer to a character pointer variable to receive the decoded result. Dynamic memory is allocated for the variable using the rtxMemAlloc function.
Returns:
Completion status of operation:
  • 0 (0) = success,
  • negative return value is error.