12 #define CER_MAX_PRIMITIVESTRING 1000 // defined in the standard
15 kAsn1Universal = 0x00,
16 kAsn1Application = 0x40,
21 enum ASN1_UniversalTag {
23 kAsn1EndSequence = 0x00,
27 kAsn1OctetString = 0x04,
29 kAsn1Utf8String = 0x0c,
30 kAsn1NumericString = 0x12,
31 kAsn1PrintableString = 0x13,
32 kAsn1TeletexString = 0x14,
33 kAsn1VideotexString = 0x15,
35 kAsn1GeneralizedTime = 0x17,
36 kAsn1GraphicString = 0x18,
37 kAsn1VisibleString = 0x19,
38 kAsn1GeneralString = 0x1a,
39 kAsn1UniversalString = 0x1b,
40 kAsn1CharacterString = 0x1c,
41 kAsn1BMPString = 0x1d,
46 const char* what()
const noexcept
override {
return "ASN.1 deserialization error"; }
56 uint8_t cer_decode_token(
const std::string& ber, int32_t* endpos, int32_t* int_param, std::string* string_param);
58 std::string cer_encode_integer(int32_t number);
59 std::string cer_encode_string(
const std::string& contents, ASN1_UniversalTag tag);