BerObjectContent::Unknown carries the BerTag but not the BerClass. I don't know why this is, it seems like an oversight, but the class is stored in the BerObjectHeader. Unfortunately, the BerObject::as_pretty() method only prints the contents (barring the ShowHeader flag). What's more, it prints the enum name for any BerTags even if they don't belong to the Universal class. This means that my pretty-printed object is showing up containing a Sequence[Unknown(EndOfContent,[de, ad, be, ef])]. Printing the header tells me this is actually a context-specific tag, which means it should have been printed as something like Sequence[Unknown(ContextSpecific(0),[de, ad, be, ef])] instead.
BerObjectContent::Unknown
carries theBerTag
but not theBerClass
. I don't know why this is, it seems like an oversight, but the class is stored in theBerObjectHeader
. Unfortunately, theBerObject::as_pretty()
method only prints the contents (barring theShowHeader
flag). What's more, it prints the enum name for anyBerTag
s even if they don't belong to theUniversal
class. This means that my pretty-printed object is showing up containing aSequence[Unknown(EndOfContent,[de, ad, be, ef])]
. Printing the header tells me this is actually a context-specific tag, which means it should have been printed as something likeSequence[Unknown(ContextSpecific(0),[de, ad, be, ef])]
instead.