
This purely static class provides decoder functions to convert ASN.1 data into human readable strings.
The class supports a handfull build-in decoder functions:
prRaw(), prHex(), prInt(), prAscii(), prBcd() and prTbcd().
Definition at line 71 of file asn1print.h.
| typedef void(*) OSB_LIB::Asn1Print::Decoder(const Asn1Byte *data, const size_t size, std::string &dest) |
Decoder function for ASN.1 data.
| data | ASN.1 data to decode. | |
| size | Size of ASN.1 data. | |
| dest | String to populate. |
Definition at line 82 of file asn1print.h.
| typedef std::deque<Info> OSB_LIB::Asn1Print::DecoderList |
| OSB_LIB::Asn1Print::Asn1Print | ( | ) | [private] |
Default constructor.
Adds the build-in decoders (and a few more),
use decoderList() to list all of them.
| void OSB_LIB::Asn1Print::add | ( | Decoder | decoder, | |
| const char * | name, | |||
| const char * | des | |||
| ) | [private] |
Add a decoder function.
| static void OSB_LIB::Asn1Print::add | ( | const Info & | info | ) | [static] |
Register a decoder function.
| info | Information about the decoder function. |
| static DecoderList& OSB_LIB::Asn1Print::decoderList | ( | ) | [static, private] |
Get the whole list of decoders.
| static const DecoderList& OSB_LIB::Asn1Print::decoders | ( | ) | [static] |
Get the whole list of support decoders.
| static Info* OSB_LIB::Asn1Print::find | ( | const std::string & | name | ) | [static, private] |
Find the information for a decoder.
| static const Info* OSB_LIB::Asn1Print::findInfo | ( | const std::string & | name | ) | [static] |
Find the information for a decoder.
| static Decoder OSB_LIB::Asn1Print::getDecoder | ( | const std::string & | name | ) | [static] |
Get a decoder function.
| static void OSB_LIB::Asn1Print::prAscii | ( | const Asn1Byte * | data, | |
| const size_t | size, | |||
| std::string & | dest | |||
| ) | [static] |
Print ASN.1 string data.
| static void OSB_LIB::Asn1Print::prBcd | ( | const Asn1Byte * | data, | |
| const size_t | size, | |||
| std::string & | dest | |||
| ) | [static] |
BCD encoded ASN.1 as decimal string.
| static void OSB_LIB::Asn1Print::prHex | ( | const Asn1Byte * | data, | |
| const size_t | size, | |||
| std::string & | dest | |||
| ) | [static] |
Hex format: each byte as 2-digit uppercase hex.
| static void OSB_LIB::Asn1Print::prInt | ( | const Asn1Byte * | data, | |
| const size_t | size, | |||
| std::string & | dest | |||
| ) | [static] |
Print ASN.1 integer data.
| static void OSB_LIB::Asn1Print::prRaw | ( | const Asn1Byte * | data, | |
| const size_t | size, | |||
| std::string & | dest | |||
| ) | [static] |
Raw format: each byte as 2-digit lowercase hex.
| static void OSB_LIB::Asn1Print::prTbcd | ( | const Asn1Byte * | data, | |
| const size_t | size, | |||
| std::string & | dest | |||
| ) | [static] |
TBCD encoded ASN.1 as decimal string.
DecoderList OSB_LIB::Asn1Print::decoders_ [private] |
Asn1Print* OSB_LIB::Asn1Print::instance_ [static, private] |
1.4.7