C Streaming BER Encode Functions.
[Streaming BER Runtime Library Functions.]
Functions | |
int | berEncStrmBigInt (OSCTXT *pctxt, const char *pvalue, ASN1TagType tagging) |
int | berEncStrmBigIntNchars (OSCTXT *pctxt, const char *pvalue, size_t nchars, ASN1TagType tagging) |
int | berEncStrmBitStr (OSCTXT *pctxt, const OSOCTET *object_p, OSUINT32 numbits, ASN1TagType tagging) |
int | berEncStrmBMPStr (OSCTXT *pctxt, const Asn116BitCharString *object_p, ASN1TagType tagging) |
int | berEncStrmBool (OSCTXT *pctxt, OSBOOL value, ASN1TagType tagging) |
int | berEncStrmCharStr (OSCTXT *pctxt, const char *object_p, ASN1TagType tagging, ASN1TAG tag) |
int | berEncStrmDateStr (OSCTXT *pctxt, const char *object_p, ASN1TagType tagging, ASN1TAG tag) |
int | berEncStrmDateTimeStr (OSCTXT *pctxt, const char *object_p, ASN1TagType tagging, ASN1TAG tag) |
int | berEncStrmDurationStr (OSCTXT *pctxt, const char *object_p, ASN1TagType tagging, ASN1TAG tag) |
int | berEncStrmTimeStr (OSCTXT *pctxt, const char *object_p, ASN1TagType tagging, ASN1TAG tag) |
int | berEncStrmTimeOfDayStr (OSCTXT *pctxt, const char *object_p, ASN1TagType tagging, ASN1TAG tag) |
int | berEncStrmDefLength (OSCTXT *pctxt, size_t length) |
int | berEncStrmEOC (OSCTXT *pctxt) |
int | berEncStrmEnum (OSCTXT *pctxt, OSINT32 value, ASN1TagType tagging) |
int | berEncStrmInt (OSCTXT *pctxt, OSINT32 value, ASN1TagType tagging) |
int | berEncStrmInt8 (OSCTXT *pctxt, OSINT8 value, ASN1TagType tagging) |
int | berEncStrmInt16 (OSCTXT *pctxt, OSINT16 value, ASN1TagType tagging) |
int | berEncStrmInt64 (OSCTXT *pctxt, OSINT64 value, ASN1TagType tagging) |
int | berEncStrmLength (OSCTXT *pctxt, int length) |
int | berEncStrmNull (OSCTXT *pctxt, ASN1TagType tagging) |
int | berEncStrmObjId (OSCTXT *pctxt, const ASN1OBJID *object_p, ASN1TagType tagging) |
int | berEncStrmObjId64 (OSCTXT *pctxt, const ASN1OID64 *object_p, ASN1TagType tagging) |
int | berEncStrmOctStr (OSCTXT *pctxt, const OSOCTET *object_p, OSSIZE numocts, ASN1TagType tagging) |
int | berEncStrmOpenTypeExt (OSCTXT *pctxt, OSRTDList *pElemList) |
int | berEncStrmReal (OSCTXT *pctxt, OSREAL value, ASN1TagType tagging) |
int | berEncStrmReal10 (OSCTXT *pctxt, const char *object_p, ASN1TagType tagging) |
int | cerEncStrmReal10 (OSCTXT *pctxt, const char *object_p, ASN1TagType tagging) |
int | berEncStrmRelativeOID (OSCTXT *pctxt, const ASN1OBJID *object_p, ASN1TagType tagging) |
int | berEncStrmTag (OSCTXT *pctxt, ASN1TAG tag) |
int | berEncStrmTagAndLen (OSCTXT *pctxt, ASN1TAG tag, int length) |
int | berEncStrmTagAndDefLen (OSCTXT *pctxt, ASN1TAG tag, OSSIZE length) |
int | berEncStrmTagAndIndefLen (OSCTXT *pctxt, ASN1TAG tag) |
int | berEncStrmUInt (OSCTXT *pctxt, OSUINT32 value, ASN1TagType tagging) |
int | berEncStrmUInt8 (OSCTXT *pctxt, OSUINT8 value, ASN1TagType tagging) |
int | berEncStrmUInt16 (OSCTXT *pctxt, OSUINT16 value, ASN1TagType tagging) |
int | berEncStrmUInt64 (OSCTXT *pctxt, OSUINT64 value, ASN1TagType tagging) |
int | berEncStrmUnivStr (OSCTXT *pctxt, const Asn132BitCharString *object_p, ASN1TagType tagging) |
int | berEncStrmXSDAny (OSCTXT *pctxt, OSXSDAny *pvalue, ASN1TagType tagging) |
int | berEncStrmWriteOctet (OSCTXT *pctxt, OSOCTET octet) |
int | berEncStrmWriteOctets (OSCTXT *pctxt, const OSOCTET *poctets, size_t numocts) |
int | cerEncStrmBMPStr (OSCTXT *pctxt, const Asn116BitCharString *object_p, ASN1TagType tagging) |
int | cerEncStrmBitStr (OSCTXT *pctxt, const OSOCTET *object_p, OSUINT32 numbits, ASN1TagType tagging) |
int | cerEncStrmCharStr (OSCTXT *pctxt, const char *object_p, ASN1TagType tagging, ASN1TAG tag) |
int | cerEncStrmOctStr (OSCTXT *pctxt, const OSOCTET *object_p, OSUINT32 numocts, ASN1TagType tagging) |
int | cerEncStrmUnivStr (OSCTXT *pctxt, const Asn132BitCharString *object_p, ASN1TagType tagging) |
Detailed Description
The C streaming BER encode functions encode ASN.1 primitive data types directly to the output stream. It must be already opened by using any of the following functions: rtxStreamFileOpen, rtxStreamFileAttach, rtxStreamSocketAttach, rtxStreamMemoryCreate, rtxStreamMemoryAttach.
The streaming BER encoding uses indefinite length form for encode complex ASN.1 types.
Function Documentation
int berEncStrmBigInt | ( | OSCTXT * | pctxt, | |
const char * | pvalue, | |||
ASN1TagType | tagging | |||
) |
This function encodes 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.
- 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. pvalue A pointer to a character string containing the value to be encoded. tagging An enumerated type whose value is set to either 'ASN1EXPL' (for explicit tagging) or 'ASN1IMPL' (for implicit). Controls whether the universal tag value for this type is added or not. Users will generally always set this value to 'ASN1EXPL'.
- Returns:
- Completion status of operation: 0 (0) = success, negative return value is error.
int berEncStrmBigIntNchars | ( | OSCTXT * | pctxt, | |
const char * | pvalue, | |||
size_t | nchars, | |||
ASN1TagType | tagging | |||
) |
This function is similar to the berEncStrmBigInt
function except that only the given number of characters from the character string are used as the value to be encoded.
- 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. pvalue A pointer to a character string containing the value to be encoded. nchars Number of characters from pvalue to encode. tagging An enumerated type whose value is set to either 'ASN1EXPL' (for explicit tagging) or 'ASN1IMPL' (for implicit). Controls whether the universal tag value for this type is added or not. Users will generally always set this value to 'ASN1EXPL'.
- Returns:
- Completion status of operation: 0 (0) = success, negative return value is error.
int berEncStrmBitStr | ( | OSCTXT * | pctxt, | |
const OSOCTET * | object_p, | |||
OSUINT32 | numbits, | |||
ASN1TagType | tagging | |||
) |
This function encodes a variable of the ASN.1 BIT STRING 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_p A pointer to an OCTET string containing the bit data to be encoded. This string contains bytes having the actual bit settings as they are to be encoded in the message. numbits The number of bits within the bit string to be encoded. tagging An enumerated type whose value is set to either 'ASN1EXPL' (for explicit tagging) or 'ASN1IMPL' (for implicit). Controls whether the universal tag value for this type is added or not. Users will generally always set this value to 'ASN1EXPL'.
- Returns:
- Completion status of operation: 0 (0) = success, negative return value is error.
int berEncStrmBMPStr | ( | OSCTXT * | pctxt, | |
const Asn116BitCharString * | object_p, | |||
ASN1TagType | tagging | |||
) |
This function encodes a variable of the ASN.1 BMPString type that is based on a 16-bit character sets.
- 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_p A pointer to a structure representing a 16-bit character string to be encoded. This structure contains a character count element and a pointer to an array of 16-bit character elements represented as 16-bit short integers. tagging An enumerated type whose value is set to either 'ASN1EXPL' (for explicit tagging) or 'ASN1IMPL' (for implicit). Controls whether the universal tag value for this type is added or not. Users will generally always set this value to 'ASN1EXPL'.
- Returns:
- Completion status of operation: 0 (0) = success, negative return value is error.
int berEncStrmBool | ( | OSCTXT * | pctxt, | |
OSBOOL | value, | |||
ASN1TagType | tagging | |||
) |
This function encodes a variable of the ASN.1 BOOLEAN 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. value A BOOLEAN value to be encoded. A BOOLEAN is defined as a single OCTET whose value is 0 for FALSE and any other value for TRUE. tagging An enumerated type whose value is set to either 'ASN1EXPL' (for explicit tagging) or 'ASN1IMPL' (for implicit). Controls whether the universal tag value for this type is added or not. Users will generally always set this value to 'ASN1EXPL'.
- Returns:
- Completion status of operation: 0 (0) = success, negative return value is error.
int berEncStrmCharStr | ( | OSCTXT * | pctxt, | |
const char * | object_p, | |||
ASN1TagType | tagging, | |||
ASN1TAG | tag | |||
) |
This function encodes a variable one of the ASN.1 character string types that are based on 8-bit character sets. This includes IA5String, VisibleString, PrintableString, and NumericString.
- 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_p A pointer to a null-terminated C character string to be encoded. tagging An enumerated type whose value is set to either 'ASN1EXPL' (for explicit tagging) or 'ASN1IMPL' (for implicit). Controls whether the universal tag value for this type is added or not. Users will generally always set this value to 'ASN1EXPL'. tag The ASN.1 tag to be encoded in the message. This parameter is passed using the ASN1C internal tag representation. It is passed as an unsigned 32-bit integer.
- Returns:
- Completion status of operation: 0 (0) = success, negative return value is error.
int berEncStrmDateStr | ( | OSCTXT * | pctxt, | |
const char * | object_p, | |||
ASN1TagType | tagging, | |||
ASN1TAG | tag | |||
) |
This function encodes a variable one of the ASN.1 ISO 8601 Date character string types.
- 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_p A pointer to a null-terminated C character string to be encoded. tagging An enumerated type whose value is set to either 'ASN1EXPL' (for explicit tagging) or 'ASN1IMPL' (for implicit). Controls whether the universal tag value for this type is added or not. Users will generally always set this value to 'ASN1EXPL'. tag The ASN.1 tag to be encoded in the message. This parameter is passed using the ASN1C internal tag representation. It is passed as an unsigned 32-bit integer.
- Returns:
- Completion status of operation: 0 (0) = success, negative return value is error.
int berEncStrmDateTimeStr | ( | OSCTXT * | pctxt, | |
const char * | object_p, | |||
ASN1TagType | tagging, | |||
ASN1TAG | tag | |||
) |
This function encodes a variable one of the ASN.1 ISO 8601 Date/Time character string types.
- 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_p A pointer to a null-terminated C character string to be encoded. tagging An enumerated type whose value is set to either 'ASN1EXPL' (for explicit tagging) or 'ASN1IMPL' (for implicit). Controls whether the universal tag value for this type is added or not. Users will generally always set this value to 'ASN1EXPL'. tag The ASN.1 tag to be encoded in the message. This parameter is passed using the ASN1C internal tag representation. It is passed as an unsigned 32-bit integer.
- Returns:
- Completion status of operation: 0 (0) = success, negative return value is error.
int berEncStrmDefLength | ( | OSCTXT * | pctxt, | |
size_t | length | |||
) |
This function encodes a definite length field to the stream.
- 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. length Length to be encoded.
- Returns:
- Completion status of operation: 0 (0) = success, negative return value is error.
int berEncStrmDurationStr | ( | OSCTXT * | pctxt, | |
const char * | object_p, | |||
ASN1TagType | tagging, | |||
ASN1TAG | tag | |||
) |
This function encodes a variable one of the ASN.1 ISO 8601 Duration character string types.
- 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_p A pointer to a null-terminated C character string to be encoded. tagging An enumerated type whose value is set to either 'ASN1EXPL' (for explicit tagging) or 'ASN1IMPL' (for implicit). Controls whether the universal tag value for this type is added or not. Users will generally always set this value to 'ASN1EXPL'. tag The ASN.1 tag to be encoded in the message. This parameter is passed using the ASN1C internal tag representation. It is passed as an unsigned 32-bit integer.
- Returns:
- Completion status of operation: 0 (0) = success, negative return value is error.
int berEncStrmEnum | ( | OSCTXT * | pctxt, | |
OSINT32 | value, | |||
ASN1TagType | tagging | |||
) |
This function encodes a variable of the ASN.1 ENUMERATED type. The enumerated encoding is identical to that of an integer. The compiler adds additional checks to the generated code to ensure the value is within the given set.
- 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. value An integer containing the enumerated value to be encoded. tagging An enumerated type whose value is set to either 'ASN1EXPL' (for explicit tagging) or 'ASN1IMPL' (for implicit). Controls whether the universal tag value for this type is added or not. Users will generally always set this value to 'ASN1EXPL'.
- Returns:
- Completion status of operation: 0 (0) = success, negative return value is error.
int berEncStrmEOC | ( | OSCTXT * | pctxt | ) |
This function encodes end-of-contents octets (EOC) into the stream. EOC is two zero octets (it is documented in the X.690 standard). This function must be called when the encoding of the complex type with indefinite length is finishing (see berEncStrmTagAndIndefLen).
- 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.
- Returns:
- Completion status of operation: 0 (0) = success, negative return value is error.
int berEncStrmInt | ( | OSCTXT * | pctxt, | |
OSINT32 | value, | |||
ASN1TagType | tagging | |||
) |
This function encodes a variable of the ASN.1 INTEGER 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. value An INTEGER value to be encoded. The OSINT32 type is set to the C type 'int' in the asn1type.h file. This is assumed to represent a 32-bit integer value. tagging An enumerated type whose value is set to either 'ASN1EXPL' (for explicit tagging) or 'ASN1IMPL' (for implicit). Controls whether the universal tag value for this type is added or not. Users will generally always set this value to 'ASN1EXPL'.
- Returns:
- Completion status of operation: 0 (0) = success, negative return value is error.
int berEncStrmInt16 | ( | OSCTXT * | pctxt, | |
OSINT16 | value, | |||
ASN1TagType | tagging | |||
) |
This function encodes a 16-bit variable of the ASN.1 INTEGER 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. value A 16-bit INTEGER value to be encoded. The OSINT16 type is set to the C type 'signed short' in the asn1type.h file. This is assumed to represent a 16-bit integer value. tagging An enumerated type whose value is set to either 'ASN1EXPL' (for explicit tagging) or 'ASN1IMPL' (for implicit). Controls whether the universal tag value for this type is added or not. Users will generally always set this value to 'ASN1EXPL'.
- Returns:
- Completion status of operation: 0 (0) = success, negative return value is error.
int berEncStrmInt64 | ( | OSCTXT * | pctxt, | |
OSINT64 | value, | |||
ASN1TagType | tagging | |||
) |
This function encodes a 64-bit variable of the ASN.1 INTEGER 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. value A 64-bit INTEGER value to be encoded. The OSINT64 type is set to the C type '__int64', 'long long' or 'long' in the asn1type.h file (depends on the used platform and the compiler). This is assumed to represent a 64-bit integer value. tagging An enumerated type whose value is set to either 'ASN1EXPL' (for explicit tagging) or 'ASN1IMPL' (for implicit). Controls whether the universal tag value for this type is added or not. Users will generally always set this value to 'ASN1EXPL'.
- Returns:
- Completion status of operation: 0 (0) = success, negative return value is error.
int berEncStrmInt8 | ( | OSCTXT * | pctxt, | |
OSINT8 | value, | |||
ASN1TagType | tagging | |||
) |
This function encodes an 8-bit variable of the ASN.1 INTEGER 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. value An 8-bit INTEGER value to be encoded. The OSINT8 type is set to the C type 'signed char' in the asn1type.h file. This is assumed to represent an 8-bit integer value. tagging An enumerated type whose value is set to either 'ASN1EXPL' (for explicit tagging) or 'ASN1IMPL' (for implicit). Controls whether the universal tag value for this type is added or not. Users will generally always set this value to 'ASN1EXPL'.
- Returns:
- Completion status of operation: 0 (0) = success, negative return value is error.
int berEncStrmLength | ( | OSCTXT * | pctxt, | |
int | length | |||
) |
This function is used to encode a BER length determinant value.
- 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. length The length variable to encode. An ASN_K_INDEFLEN constant is interpreted that an indefinite length identifier should be encoded.
- Returns:
- Completion status of operation: 0 (0) = success, negative return value is error.
int berEncStrmNull | ( | OSCTXT * | pctxt, | |
ASN1TagType | tagging | |||
) |
This function encodes an ASN.1 NULL placeholder.
- 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. tagging An enumerated type whose value is set to either 'ASN1EXPL' (for explicit tagging) or 'ASN1IMPL' (for implicit). Controls whether the universal tag value for this type is added or not. Users will generally always set this value to 'ASN1EXPL'.
- Returns:
- Completion status of operation: 0 (0) = success, negative return value is error.
int berEncStrmObjId | ( | OSCTXT * | pctxt, | |
const ASN1OBJID * | object_p, | |||
ASN1TagType | tagging | |||
) |
This function encodes a variable of the ASN.1 OBJECT IDENTIFIER 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_p 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. tagging An enumerated type whose value is set to either 'ASN1EXPL' (for explicit tagging) or 'ASN1IMPL' (for implicit). Controls whether the universal tag value for this type is added or not. Users will generally always set this value to 'ASN1EXPL'.
- Returns:
- Completion status of operation: 0 (0) = success, negative return value is error.
int berEncStrmObjId64 | ( | OSCTXT * | pctxt, | |
const ASN1OID64 * | object_p, | |||
ASN1TagType | tagging | |||
) |
This function encodes a variable of the ASN.1 OBJECT IDENTIFIER type using 64-bit subidentifiers.
- 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_p A pointer to a 64-bit object identifier structure. This structure contains an integer to hold the number of subidentifers in the object and an array of 64-bit unsigned integers to hold the subidentifier values. tagging An enumerated type whose value is set to either 'ASN1EXPL' (for explicit tagging) or 'ASN1IMPL' (for implicit). Controls whether the universal tag value for this type is added or not. Users will generally always set this value to 'ASN1EXPL'.
- Returns:
- Completion status of operation: 0 (0) = success, negative return value is error.
int berEncStrmOctStr | ( | OSCTXT * | pctxt, | |
const OSOCTET * | object_p, | |||
OSSIZE | numocts, | |||
ASN1TagType | tagging | |||
) |
This function encodes a variable of the ASN.1 OCTET STRING 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_p A pointer to an OCTET STRING containing the octet data to be encoded. numocts The number of octets (bytes) within the OCTET STRING to be encoded. tagging An enumerated type whose value is set to either 'ASN1EXPL' (for explicit tagging) or 'ASN1IMPL' (for implicit). Controls whether the universal tag value for this type is added or not. Users will generally always set this value to 'ASN1EXPL'.
- Returns:
- Completion status of operation: 0 (0) = success, negative return value is error.
int berEncStrmOpenTypeExt | ( | OSCTXT * | pctxt, | |
OSRTDList * | pElemList | |||
) |
This function encodes an ASN.1 open type extension. An open type extension is defined as an extensibility marker on a constructed type without any extension elements defined (for example, SEQUENCE { a INTEGER, : }). The difference is that this is an implicit field that can span one or more elements whereas the standard Open Type is assumed to be a single tagged field.
- 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. pElemList The pointer to linked list structure. The list will contain elements of ASN1OpenType type.
- Returns:
- Completion status of operation: 0 (0) = success, negative return value is error.
int berEncStrmReal | ( | OSCTXT * | pctxt, | |
OSREAL | value, | |||
ASN1TagType | tagging | |||
) |
This function encodes a variable of the REAL data 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.
- 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. value An OSREAL data type. This is defined to be the C double type. Special real values plus and minus infinity are encoded by using the rtxGetPlusInfinity and rtxGetMinusInfinity functions to set the real value to be encoded. tagging An enumerated type whose value is set to either 'ASN1EXPL' (for explicit tagging) or 'ASN1IMPL' (for implicit). Controls whether the universal tag value for this type is added or not. Users will generally always set this value to 'ASN1EXPL'.
- Returns:
- Completion status of operation: 0 (0) = success, negative return value is error.
int berEncStrmReal10 | ( | OSCTXT * | pctxt, | |
const char * | object_p, | |||
ASN1TagType | tagging | |||
) |
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.
- Parameters:
-
pctxt Pointer to a context structure. This provides a storage area for the function to store al working variables that must be maintained between function calls. object_p Value to be encoded. tagging An enumerated type whose value is set to either 'ASN1EXPL' (for explicit tagging) or 'ASN1IMPL' (for implicit). Controls whether the universal tag value for this type is added or not. Users will generally always set this value to 'ASN1EXPL'.
- Returns:
- Completion status of operation: 0 (0) = success, negative return value is error.
int berEncStrmRelativeOID | ( | OSCTXT * | pctxt, | |
const ASN1OBJID * | object_p, | |||
ASN1TagType | tagging | |||
) |
This function encodes a variable of the ASN.1 RELATIVE-OID 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_p 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. tagging An enumerated type whose value is set to either 'ASN1EXPL' (for explicit tagging) or 'ASN1IMPL' (for implicit). Controls whether the universal tag value for this type is added or not. Users will generally always set this value to 'ASN1EXPL'.
- Returns:
- Completion status of operation: 0 (0) = success, negative return value is error.
int berEncStrmTag | ( | OSCTXT * | pctxt, | |
ASN1TAG | tag | |||
) |
This function is used to encode the ASN.1 tag field that preface each block of message data. The ASN1C compiler generates calls to this function to handle the encoding of user-defined tags within an ASN.1 specification.
- 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. tag The ASN.1 tag to be encoded in the message. This parameter is passed using the ASN1C internal tag representation. It is passed as an unsigned 32-bit integer.
- Returns:
- Completion status of operation: 0 (0) = success, negative return value is error.
int berEncStrmTagAndDefLen | ( | OSCTXT * | pctxt, | |
ASN1TAG | tag, | |||
OSSIZE | length | |||
) |
This function is used to encode the ASN.1 tag and length fields that preface each block of message data. The ASN1C compiler generates calls to this function to handle the encoding of user-defined tags within an ASN.1 specification. This function is also called from within the run-time library functions to handle the addition of the universal tags defined for each of the ASN.1 primitive data types. This version will always encode the length value in definite length form.
- 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. tag The ASN.1 tag to be encoded in the message. This parameter is passed using the ASN1C internal tag representation. It is passed as an unsigned 32-bit integer. length The length of the contents field.
- Returns:
- Completion status of operation: 0 (0) = success, negative return value is error.
int berEncStrmTagAndIndefLen | ( | OSCTXT * | pctxt, | |
ASN1TAG | tag | |||
) |
This function is used to encode a tag value and an indefinite length. This can be used to manually create an indefinite length wrapper around long or constructed records.
- 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. tag The ASN.1 tag to be encoded in the message. This parameter is passed using the ASN1C internal tag representation. It is passed as an unsigned 32-bit integer.
- Returns:
- Completion status of operation: 0 (0) = success, negative return value is error.
int berEncStrmTagAndLen | ( | OSCTXT * | pctxt, | |
ASN1TAG | tag, | |||
int | length | |||
) |
This function is used to encode the ASN.1 tag and length fields that preface each block of message data. The ASN1C compiler generates calls to this function to handle the encoding of user-defined tags within an ASN.1 specification. This function is also called from within the run-time library functions to handle the addition of the universal tags defined for each of the ASN.1 primitive data types.
- 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. tag The ASN.1 tag to be encoded in the message. This parameter is passed using the ASN1C internal tag representation. It is passed as an unsigned 32-bit integer. length The length of the contents field. This parameter can be used to specify the actual length, or the special constant 'ASN_K_INDEFLEN' can be used to specify that an indefinite length specification should be encoded.
- Returns:
- Completion status of operation: 0 (0) = success, negative return value is error.
int berEncStrmTimeOfDayStr | ( | OSCTXT * | pctxt, | |
const char * | object_p, | |||
ASN1TagType | tagging, | |||
ASN1TAG | tag | |||
) |
This function encodes a variable one of the ASN.1 ISO 8601 Time-Of-Day character string types.
- 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_p A pointer to a null-terminated C character string to be encoded. tagging An enumerated type whose value is set to either 'ASN1EXPL' (for explicit tagging) or 'ASN1IMPL' (for implicit). Controls whether the universal tag value for this type is added or not. Users will generally always set this value to 'ASN1EXPL'. tag The ASN.1 tag to be encoded in the message. This parameter is passed using the ASN1C internal tag representation. It is passed as an unsigned 32-bit integer.
- Returns:
- Completion status of operation: 0 (0) = success, negative return value is error.
int berEncStrmTimeStr | ( | OSCTXT * | pctxt, | |
const char * | object_p, | |||
ASN1TagType | tagging, | |||
ASN1TAG | tag | |||
) |
This function encodes a variable one of the ASN.1 ISO 8601 Time character string types.
- 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_p A pointer to a null-terminated C character string to be encoded. tagging An enumerated type whose value is set to either 'ASN1EXPL' (for explicit tagging) or 'ASN1IMPL' (for implicit). Controls whether the universal tag value for this type is added or not. Users will generally always set this value to 'ASN1EXPL'. tag The ASN.1 tag to be encoded in the message. This parameter is passed using the ASN1C internal tag representation. It is passed as an unsigned 32-bit integer.
- Returns:
- Completion status of operation: 0 (0) = success, negative return value is error.
int berEncStrmUInt | ( | OSCTXT * | pctxt, | |
OSUINT32 | value, | |||
ASN1TagType | tagging | |||
) |
This function encodes an unsigned variable of the ASN.1 INTEGER 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. value An unsigned INTEGER value to be encoded. The OSUINT32 type is set to the C type 'unsigned int' in the asn1type.h file. This is assumed to represent a 32-bit integer value. tagging An enumerated type whose value is set to either 'ASN1EXPL' (for explicit tagging) or 'ASN1IMPL' (for implicit). Controls whether the universal tag value for this type is added or not. Users will generally always set this value to 'ASN1EXPL'.
- Returns:
- Completion status of operation: 0 (0) = success, negative return value is error.
int berEncStrmUInt16 | ( | OSCTXT * | pctxt, | |
OSUINT16 | value, | |||
ASN1TagType | tagging | |||
) |
This function encodes an unsigned 16-bit variable of the ASN.1 INTEGER 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. value An unsigned 16-bit INTEGER value to be encoded. The OSUINT16 type is set to the C type 'unsigned short' in the asn1type.h file. This is assumed to represent a 16-bit integer value. tagging An enumerated type whose value is set to either 'ASN1EXPL' (for explicit tagging) or 'ASN1IMPL' (for implicit). Controls whether the universal tag value for this type is added or not. Users will generally always set this value to 'ASN1EXPL'.
- Returns:
- Completion status of operation: 0 (0) = success, negative return value is error.
int berEncStrmUInt64 | ( | OSCTXT * | pctxt, | |
OSUINT64 | value, | |||
ASN1TagType | tagging | |||
) |
This function encodes an unsigned 64-bit variable of the ASN.1 INTEGER 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. value An unsigned 64-bit INTEGER value to be encoded. The OSUINT64 type is set to the C type 'unsigned __int64', 'unsigned long long' or 'unsigned long' in the asn1type.h file (depends on the used platform and the compiler). This is assumed to represent a 64-bit integer value. tagging An enumerated type whose value is set to either 'ASN1EXPL' (for explicit tagging) or 'ASN1IMPL' (for implicit). Controls whether the universal tag value for this type is added or not. Users will generally always set this value to 'ASN1EXPL'.
- Returns:
- Completion status of operation: 0 (0) = success, negative return value is error.
int berEncStrmUInt8 | ( | OSCTXT * | pctxt, | |
OSUINT8 | value, | |||
ASN1TagType | tagging | |||
) |
This function encodes an unsigned 8-bit variable of the ASN.1 INTEGER 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. value An unsigned 8-bit INTEGER value to be encoded. The OSOCTET type is set to the C type 'unsigned char' in the asn1type.h file. This is assumed to represent an 8-bit integer value. tagging An enumerated type whose value is set to either 'ASN1EXPL' (for explicit tagging) or 'ASN1IMPL' (for implicit). Controls whether the universal tag value for this type is added or not. Users will generally always set this value to 'ASN1EXPL'.
- Returns:
- Completion status of operation: 0 (0) = success, negative return value is error.
int berEncStrmUnivStr | ( | OSCTXT * | pctxt, | |
const Asn132BitCharString * | object_p, | |||
ASN1TagType | tagging | |||
) |
This function encodes a variable of the ASN.1 UniversalString type that is based on a 32-bit character sets.
- 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_p A pointer to a structure representing a 32-bit character string to be encoded. This structure contains a character count element and a pointer to an array of 32-bit character elements represented as 32-bit unsigned integers. tagging An enumerated type whose value is set to either 'ASN1EXPL' (for explicit tagging) or 'ASN1IMPL' (for implicit). Controls whether the universal tag value for this type is added or not. Users will generally always set this value to 'ASN1EXPL'.
- Returns:
- Completion status of operation: 0 (0) = success, negative return value is error.
int berEncStrmWriteOctet | ( | OSCTXT * | pctxt, | |
OSOCTET | octet | |||
) |
This function puts one octet into the output stream. It is used inside the run-time library or may be used by user to encode indicator of indefinite length (0x80, as defined in ITU-T X.690 standard).
- 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. octet The octet to be encoded.
- Returns:
- Completion status of operation: 0 (0) = success, negative return value is error.
int berEncStrmWriteOctets | ( | OSCTXT * | pctxt, | |
const OSOCTET * | poctets, | |||
size_t | numocts | |||
) |
This function puts an array of octets into the output stream. It is used inside the run-time library or may be used by user to encode end-of-contents octets (EOC) or open type's content.
- 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. poctets The array of octets to be encoded. numocts The number of octets in the array.
- Returns:
- Completion status of operation: 0 (0) = success, negative return value is error.
int berEncStrmXSDAny | ( | OSCTXT * | pctxt, | |
OSXSDAny * | pvalue, | |||
ASN1TagType | tagging | |||
) |
This function encodes a variable of the XSD any element wildcard type. It is only used in generated code when and XSD file is compiled. It provides the option to encode the wildcard element as XML text or in binary form if ASN.1 binary encoding rules are being used.
- 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. pvalue A pointer to a structure representing an XSD Any (xsd:any) type to be encoded. The structure contains a union of XML text or binary data. tagging An enumerated type whose value is set to either 'ASN1EXPL' (for explicit tagging) or 'ASN1IMPL' (for implicit). Controls whether the universal tag value for this type is added or not. Users will generally always set this value to 'ASN1EXPL'.
- Returns:
- Completion status of operation: 0 (0) = success, negative return value is error.
int cerEncStrmBitStr | ( | OSCTXT * | pctxt, | |
const OSOCTET * | object_p, | |||
OSUINT32 | numbits, | |||
ASN1TagType | tagging | |||
) |
This function encodes a variable of the ASN.1 BIT STRING type with using Canonical Encoding Rules (CER).
- 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_p A pointer to an OCTET string containing the bit data to be encoded. This string contains bytes having the actual bit settings as they are to be encoded in the message. numbits The number of bits within the bit string to be encoded. tagging An enumerated type whose value is set to either 'ASN1EXPL' (for explicit tagging) or 'ASN1IMPL' (for implicit). Controls whether the universal tag value for this type is added or not. Users will generally always set this value to 'ASN1EXPL'.
- Returns:
- Completion status of operation: 0 (0) = success, negative return value is error.
int cerEncStrmBMPStr | ( | OSCTXT * | pctxt, | |
const Asn116BitCharString * | object_p, | |||
ASN1TagType | tagging | |||
) |
This function encodes a variable of the ASN.1 BMPString type with using Canonical Encoding Rules (CER). BMPString type is based on a 16-bit character sets.
- 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_p A pointer to a structure representing a 16-bit character string to be encoded. This structure contains a character count element and a pointer to an array of 16-bit character elements represented as 16-bit short integers. tagging An enumerated type whose value is set to either 'ASN1EXPL' (for explicit tagging) or 'ASN1IMPL' (for implicit). Controls whether the universal tag value for this type is added or not. Users will generally always set this value to 'ASN1EXPL'.
- Returns:
- Completion status of operation: 0 (0) = success, negative return value is error.
int cerEncStrmCharStr | ( | OSCTXT * | pctxt, | |
const char * | object_p, | |||
ASN1TagType | tagging, | |||
ASN1TAG | tag | |||
) |
This function encodes a variable one of the ASN.1 character string types that are based on 8-bit character sets with using Canonical Encoding Rules (CER). This includes IA5String, VisibleString, PrintableString, and NumericString.
- 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_p A pointer to a null-terminated C character string to be encoded. tagging An enumerated type whose value is set to either 'ASN1EXPL' (for explicit tagging) or 'ASN1IMPL' (for implicit). Controls whether the universal tag value for this type is added or not. Users will generally always set this value to 'ASN1EXPL'. tag The ASN.1 tag to be encoded in the message. This parameter is passed using the ASN1C internal tag representation. It is passed as an unsigned 32-bit integer.
- Returns:
- Completion status of operation: 0 (0) = success, negative return value is error.
int cerEncStrmOctStr | ( | OSCTXT * | pctxt, | |
const OSOCTET * | object_p, | |||
OSUINT32 | numocts, | |||
ASN1TagType | tagging | |||
) |
This function encodes a variable of the ASN.1 OCTET STRING type with using Canonical Encoding Rules (CER).
- 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_p A pointer to an OCTET STRING containing the octet data to be encoded. numocts The number of octets (bytes) within the OCTET STRING to be encoded. tagging An enumerated type whose value is set to either 'ASN1EXPL' (for explicit tagging) or 'ASN1IMPL' (for implicit). Controls whether the universal tag value for this type is added or not. Users will generally always set this value to 'ASN1EXPL'.
- Returns:
- Completion status of operation: 0 (0) = success, negative return value is error.
int cerEncStrmReal10 | ( | OSCTXT * | pctxt, | |
const char * | object_p, | |||
ASN1TagType | tagging | |||
) |
This function will encode a number from character string to ASN.1 real type with using CER/DER decimal encoding. Number may be represented in integer, decimal, and exponent formats.
- Parameters:
-
pctxt Pointer to a context structure. This provides a storage area for the function to store al working variables that must be maintained between function calls. object_p Value to be encoded. tagging An enumerated type whose value is set to either 'ASN1EXPL' (for explicit tagging) or 'ASN1IMPL' (for implicit). Controls whether the universal tag value for this type is added or not. Users will generally always set this value to 'ASN1EXPL'.
- Returns:
- Completion status of operation: 0 (0) = success, negative return value is error.
int cerEncStrmUnivStr | ( | OSCTXT * | pctxt, | |
const Asn132BitCharString * | object_p, | |||
ASN1TagType | tagging | |||
) |
This function encodes a variable of the ASN.1 UniversalString type with using Canonical Encoding Rules (CER). UniversalString type is based on a 32-bit character sets.
- 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_p A pointer to a structure representing a 32-bit character string to be encoded. This structure contains a character count element and a pointer to an array of 32-bit character elements represented as 32-bit unsigned integers. tagging An enumerated type whose value is set to either 'ASN1EXPL' (for explicit tagging) or 'ASN1IMPL' (for implicit). Controls whether the universal tag value for this type is added or not. Users will generally always set this value to 'ASN1EXPL'.
- Returns:
- Completion status of operation: 0 (0) = success, negative return value is error.