[botan-devel] ASN.1 parsing: how to get complete TLV structure

Lösch, Sebastian slo at bos-bremen.de
Fri Dec 6 07:42:33 EST 2013

I am parsing an ASN.1 structure and want to get an element's raw bytes, i.e. the complete TLV structure of an element as byte array.

Assume the following structure:
Parent::= SEQUENCE {
childOne ChildOneType,
childTwo ChildTwoType
I want to get the byte array of childOne.

I start parsing with an instance of BER_Decoder holding the data of element Parent.
BER_Decoder parentDecoder(...);
Then I parse the sequence
                BER_Decoder childDecoder = parentDecoder.start_const(SEQUENCE);
What do I have to do to get the whole element childOne?

Thank you very much in advance for your answer,
Sebastian Lösch

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.randombit.net/pipermail/botan-devel/attachments/20131206/5e3914d5/attachment-0001.html>

More information about the botan-devel mailing list