Provide functions to encode and decode simple types in BER format.
More...
Detailed Description
- Outline
-
-
- Purpose:
- Provide functions to encode and decode simple types in BER format.
-
- Classes:
-
- See also:
- Component balber_berencoder, Component balber_berdecoder
-
- Description:
- This component provides utility functions for encoding and decoding of primitive BER constructs, such as tag identifier octets, length octets, fundamental C++ types. The encoding and decoding of
bsl::string
and BDE date/time types is also implemented.
- These utility functions operate on
bsl::streambuf
for buffer management.
- More information about BER constructs can be found in the BER specification (X.690). A copy of the specification can be found at the URL:
- Note that this is a low-level component that only encodes and decodes primitive constructs. Clients should use the
balber_berencoder
and balber_berdecoder
components (which use this component in the implementation) to encode and decode well-formed BER messages.
-
- Terminology:
- The documentation of this component occasionally uses the following terminology as shorthand:
date-and-time value:
The value associated with an object of a date-and-time type.
-
- Usage:
- This section illustrates intended use of this component.
-
- Example 1: Reading and Writing Identifier Octets:
- The following snippets of code illustrate the usage of this component. Due to the low-level nature of this component, an extended usage example is not necessary.
- Suppose we wanted to write the identifier octets for a BER tag having the following properties:
Tag Class: Context-specific
Tag Type: Primitive
Tag Number: 31
According to the BER specification, this should generate two octets containing the values 0x9F and 0x1F. The following function demonstrates this: The next part of the function will read the identifier octets from the stream and verify its contents: