PER C Encode Functions.
[PER Runtime Library Functions.]
Detailed Description
The Per low-level encode functions handle the PER encoding of the primitive ASN.1 data types. Calls to these functions are assembled in the C source code generated by the ASN1C complier to accomplish the encoding of complex ASN.1 structures. These functions are also directly callable from within a user's application program if the need to accomplish a low level encoding function exists.The procedure to call a low-level encode function is the same as the procedure to call a compiler generated encode function described above. The pu_newContext function must first be called to set a pointer to the buffer into which the variable is to be encoded. A static encode buffer is specified by assigning a pointer to a buffer and a buffer size. Setting the buffer address to NULL and buffer size to 0 specifies a dynamic buffer. The encode function is then invoked. The result of the encoding will start at the beginning of the specified buffer, or, if a dynamic buffer was used, only be obtained by calling pe_GetMsgPtr. The length of the encoded compound is obtained by calling pe_GetMsgLen.
Functions | |
| int | pe_16BitConstrainedString (OSCTXT *pctxt, Asn116BitCharString value, Asn116BitCharSet *pCharSet) |
| int | pe_32BitConstrainedString (OSCTXT *pctxt, Asn132BitCharString value, Asn132BitCharSet *pCharSet) |
| int | pe_2sCompBinInt (OSCTXT *pctxt, OSINT32 value) |
| int | pe_2sCompBinInt64 (OSCTXT *pctxt, OSINT64 value) |
| int | pe_aligned_octets (OSCTXT *pctxt, OSOCTET *pvalue, OSUINT32 nocts) |
| int | pe_BigInteger (OSCTXT *pctxt, const char *pvalue) |
| int | pe_bit (OSCTXT *pctxt, OSBOOL value) |
| int | pe_bits (OSCTXT *pctxt, OSUINT32 value, OSUINT32 nbits) |
| int | pe_bits64 (OSCTXT *pctxt, OSUINT64 value, OSUINT32 nbits) |
| int | pe_BitString (OSCTXT *pctxt, OSUINT32 numocts, const OSOCTET *data) |
| int | pe_BMPString (OSCTXT *pctxt, ASN1BMPString value, Asn116BitCharSet *permCharSet) |
| int | pe_UniversalString (OSCTXT *pctxt, ASN1UniversalString value, Asn132BitCharSet *permCharSet) |
| int | pe_byte_align (OSCTXT *pctxt) |
| int | pe_CheckBuffer (OSCTXT *pctxt, size_t nbytes) |
| int | pe_ChoiceTypeExt (OSCTXT *pctxt, OSUINT32 numocts, const OSOCTET *data) |
| int | pe_ConsInteger (OSCTXT *pctxt, OSINT32 value, OSINT32 lower, OSINT32 upper) |
| int | pe_ConsInt64 (OSCTXT *pctxt, OSINT64 value, OSINT64 lower, OSINT64 upper) |
| int | pe_ConstrainedString (OSCTXT *pctxt, const char *string, Asn1CharSet *pCharSet) |
| int | pe_ConstrainedStringEx (OSCTXT *pctxt, const char *string, const char *charSet, OSUINT32 abits, OSUINT32 ubits, OSUINT32 canSetBits) |
| int | pe_ConsUnsigned (OSCTXT *pctxt, OSUINT32 value, OSUINT32 lower, OSUINT32 upper) |
| int | pe_ConsUInt64 (OSCTXT *pctxt, OSUINT64 value, OSUINT64 lower, OSUINT64 upper) |
| int | pe_ConsWholeNumber (OSCTXT *pctxt, OSUINT32 adjusted_value, OSUINT32 range_value) |
| int | pe_ConsWholeNumber64 (OSCTXT *pctxt, OSUINT64 adjusted_value, OSUINT64 range_value) |
| int | pe_ExpandBuffer (OSCTXT *pctxt, size_t nbytes) |
| OSUINT32 | pe_GetIntLen (OSUINT32 value) |
| size_t | pe_GetMsgBitCnt (OSCTXT *pctxt) |
| OSOCTET * | pe_GetMsgPtr (OSCTXT *pctxt, OSINT32 *pLength) |
| OSOCTET * | pe_GetMsgPtrU (OSCTXT *pctxt, OSUINT32 *pLength) |
| int | pe_Length (OSCTXT *pctxt, OSUINT32 value) |
| int | pe_NonNegBinInt (OSCTXT *pctxt, OSUINT32 value) |
| int | pe_NonNegBinInt64 (OSCTXT *pctxt, OSUINT64 value) |
| int | pe_ObjectIdentifier (OSCTXT *pctxt, ASN1OBJID *pvalue) |
| int | pe_oid64 (OSCTXT *pctxt, ASN1OID64 *pvalue) |
| int | pe_RelativeOID (OSCTXT *pctxt, ASN1OBJID *pvalue) |
| int | pe_octets (OSCTXT *pctxt, const OSOCTET *pvalue, OSUINT32 nbits) |
| int | pe_OctetString (OSCTXT *pctxt, OSUINT32 numocts, const OSOCTET *data) |
| int | pe_OpenType (OSCTXT *pctxt, OSUINT32 numocts, const OSOCTET *data) |
| int | pe_OpenTypeExt (OSCTXT *pctxt, OSRTDList *pElemList) |
| int | pe_OpenTypeExtBits (OSCTXT *pctxt, OSRTDList *pElemList) |
| int | pe_Real (OSCTXT *pctxt, OSREAL value) |
| int | pe_SmallNonNegWholeNumber (OSCTXT *pctxt, OSUINT32 value) |
| int | pe_SemiConsInteger (OSCTXT *pctxt, OSINT32 value, OSINT32 lower) |
| int | pe_SemiConsInt64 (OSCTXT *pctxt, OSINT64 value, OSINT64 lower) |
| int | pe_SemiConsUnsigned (OSCTXT *pctxt, OSUINT32 value, OSUINT32 lower) |
| int | pe_SemiConsUInt64 (OSCTXT *pctxt, OSUINT64 value, OSUINT64 lower) |
| int | pe_UnconsLength (OSCTXT *pctxt, OSUINT32 value) |
| int | pe_UnconsInteger (OSCTXT *pctxt, OSINT32 value) |
| int | pe_UnconsInt64 (OSCTXT *pctxt, OSINT64 value) |
| int | pe_UnconsUnsigned (OSCTXT *pctxt, OSUINT32 value) |
| int | pe_UnconsUInt64 (OSCTXT *pctxt, OSUINT64 value) |
| int | pe_VarWidthCharString (OSCTXT *pctxt, const char *value) |
| int | pe_Real10 (OSCTXT *pctxt, const char *pvalue) |
Function Documentation
|
||||||||||||||||
|
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 that in this release is the pe_BMPString function.
|
|
||||||||||||
|
This function encodes a two's complement binary integer as specified in Section 10.4 of the X.691 standard.
|
|
||||||||||||
|
This function encodes a two's complement binary 64-bit integer as specified in Section 10.4 of the X.691 standard.
|
|
||||||||||||||||
|
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 that in this release is the pe_UniversalString function.
|
|
||||||||||||||||
|
|
|
||||||||||||
|
The pe_BigInteger function will encode 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. Items of this type are stored in character string constant variables. They can be represented as decimal strings (with no prefixes), as hexadecimal strings starting with a "0x" prefix, as octal strings starting with a "0o" prefix or as binary strings starting with a "0b" prefix. Other radixes currently are not supported. It is highly recommended to use the hexadecimal or binary strings for better performance.
|
|
||||||||||||
|
This function will encode a varialbe of the ASN.1 BOOLEAN type in single bit,
|
|
||||||||||||||||
|
This function encodes multiple bits.
|
|
||||||||||||||||
|
This function encodes multiple bits, using unsigned 64-bit integer to hold bits.
|
|
||||||||||||||||
|
This function will encode a value of the ASN.1 bit string type.
|
|
||||||||||||||||
|
This function will encode a variable of the ASN.1 BMP character string. This differs from the encode 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.
|
|
|
This function will position the encode bit cursor on the next byte boundry.
|
|
||||||||||||
|
This function will determine if the given number of bytes will fit in the encode buffer. If not, either the buffer is expanded (if it is a dynamic buffer) or an error is signaled.
|
|
||||||||||||||||
|
|
|
||||||||||||||||||||
|
This function encodes a 64-bit integer constrained either by a value or value range constraint.
|
|
||||||||||||||||||||
|
This function encodes an integer constrained either by a value or value range constraint.
|
|
||||||||||||||||
|
This function encodes a constrained string value. This is a deprecated version of the function provided for backward compatibility.
|
|
||||||||||||||||||||||||||||
|
This function encodes a constrained string value. This version of the function allows all of the required permitted alphabet constraint parameters to be passed in as arguments.
|
|
||||||||||||||||||||
|
This function encodes an unsigned 64-bit integer constrained either by a value or value range constraint. The constrained unsigned integer option is used if: 1. The lower value of the range is >= 0, and 2. The upper value of the range is >= MAXINT
|
|
||||||||||||||||||||
|
This function encodes an unsigned integer constrained either by a value or value range constraint. The constrained unsigned integer option is used if: 1. The lower value of the range is >= 0, and 2. The upper value of the range is >= MAXINT
|
|
||||||||||||||||
|
This function encodes a constrained whole number as specified in Section 10.5 of the X.691 standard.
|
|
||||||||||||||||
|
This function encodes a constrained whole number as specified in Section 10.5 of the X.691 standard, represented as 64-bit integer.
|
|
||||||||||||
|
This function will expand the buffer to hold the given number of bytes.
|
|
|
|
|
|
|
|
||||||||||||
|
This function will return the message pointer and length of an encoded message. This function is called after a complier generated encode function to get the pointer and length of the message. It is normally used when dynamic encoding is specified because the message pointer is not known until encoding is complete. If static encoding is used, the message starts at the beginning of the specified buffer adn the pe_GetMsgLen function can be used to obtain the lenght of the message.
|
|
||||||||||||
|
|
|
||||||||||||
|
This function will encode a length determinant value.
|
|
||||||||||||
|
This function encodes a non-negative binary integer as specified in Section 10.3 of the X.691 standard.
|
|
||||||||||||
|
This function encodes a non-negative binary 64-bit integer as specified in Section 10.3 of the X.691 standard.
|
|
||||||||||||
|
This function encodes a value of the ASN.1 object identifier type.
|
|
||||||||||||||||
|
This fuction will encode an array of octets. The Octets will be encoded unaligned starting at the current bit offset within the encode buffer.
|
|
||||||||||||||||
|
This function will encode a value of the ASN.1 octet string type.
|
|
||||||||||||
|
This function encodes a value of the ASN.1 object identifier type, using 64-bit subidentifiers.
|
|
||||||||||||||||
|
This function will encode an ASN.1 open type. This used to be the ANY type, but now is used in a variety of applications requiring an encoding that can be interpreted by a decoder without a prior knowledge of the type of the variable.
|
|
||||||||||||
|
This function will encode an ASN.1 open type extension. An open type extension field is the data that potentially resides after the ... marker in a version-1 message. The open type structure contains a complete encoded bit set including option element bits or choice index, length, and data. Typically, this data is populated when a version-1 system decodes a version-2 message. The extension fields are retained and can then be re-encoded if a new message is to be sent out (for example, in a store and forward system).
|
|
||||||||||||
|
|
|
||||||||||||
|
This function will encode a value of the ASN.1 real type. This function provides support for the plus-infinity and minus-infinity special real values. Use the rtxGetPlusInfinity or rtxGetMinusInfinity functions to get these special values.
|
|
||||||||||||
|
This function will encode a number from character string to ASN.1 real type using decimal encoding. Number may be represented in integer, decimal, and exponent formats.
|
|
||||||||||||
|
This function encodes a value of the ASN.1 RELATIVE-OID type.
|
|
||||||||||||||||
|
This function encodes an semi-constrained 64-bit integer.
|
|
||||||||||||||||
|
This function encodes an semi-constrained integer.
|
|
||||||||||||||||
|
This function encodes an semi-constrained unsigned 64-bit integer.
|
|
||||||||||||||||
|
This function encodes an semi-constrained unsigned integer.
|
|
||||||||||||
|
This function will endcode a small, non-negative whole number as specified in Section 10.6 of teh 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 marker.
|
|
||||||||||||
|
This function encodes an unconstrained 64-bit integer.
|
|
||||||||||||
|
This function encodes an unconstrained integer.
|
|
||||||||||||
|
|
|
||||||||||||
|
This function encodes an unconstrained unsigned 64-bit integer.
|
|
||||||||||||
|
This function encodes an unconstrained unsigned integer.
|
|
||||||||||||||||
|
This function will encode a variable of the ASN.1 Universal character string. This differs from the encode routines for the character strings previously described in that the Universal string type is based on 32-bit characters. A 32-bit character string is modeled using an array of unsigned integers.
|
|
||||||||||||
|
This function will encode a ASN.1 character string.
|
