<html><body><span class="xfm_32511932"><div><div><span style="font-family:Arial;font-size:10pt;line-height:12pt;">Hello, everybody!</span></div><div><span style="font-family:Arial;font-size:10pt;line-height:12pt;"><br/></span></div><div><span style="font-family:Arial;font-size:10pt;line-height:12pt;">I'm trying to use OpenSSL ASN.1 template API (from asn1t.h) to parse ASN.1 objects in my application. The thing is that I have to use application tags instead of default ones:</span></div><div><span style="font-family:Arial;font-size:10pt;line-height:12pt;"><br/></span></div><div><span style="font-family:Arial;font-size:10pt;line-height:12pt;">Foo ::= [APPLICATION 13] SEQUENCE {</span></div><div><span style="font-family:Arial;font-size:10pt;line-height:12pt;">m01 INTEGER,</span></div><div><span style="font-family:Arial;font-size:10pt;line-height:12pt;">m02 OCTET STRING</span></div><div><span style="font-family:Arial;font-size:10pt;line-height:12pt;"><br/></span></div><div><span style="font-family:Arial;font-size:10pt;line-height:12pt;"><br/></span></div><div><span style="font-family:Arial;font-size:10pt;line-height:12pt;">and the macros (like ASN1_SEQUENCE) don't seem to provide app tags params, or at least I can't get how to do it.</span></div><div><br/></div><div><span style="font-family:Arial;font-size:10pt;line-height:12pt;">The macro IMPLEMENT_ASN1_FUNCTIONS seems to make use of ASN1_item_d2i which in turn calls ASN1_item_ex_d2i passing -1 as tag. </span></div><div><br/></div><div><span style="font-family:Arial;font-size:10pt;line-height:12pt;">So how do I define Foo parsing functions so that they could regognize the struct by the app tag 13? Should I simply manually tweak generated templates?  What member do I change, then? Can I just reassign the tag member of the template? How do I specify that this is application tag, not universal?</span></div><div><br/></div><div><span style="font-family:Arial;font-size:10pt;line-height:12pt;">Thank you in advance.</span></div></div></span></body></html>