Sands, Daniel dnsands at sandia.gov
Tue Aug 17 16:57:45 UTC 2021

> >> Now I would like to do the other end, where I have der and I want to
> >> parse back to the structure, using d2i()
> >>
> >> 1 - Is there a tutorial on this?
> >
> > Seems like you don't need one. If you got i2d working you should have d2i
> already!
> >
> I wasn't clear.  The input and output sides are different asn.1.
> For the input side, a poster give me the structure and I only need the i2d().
> That's done - amazing.
> This worked so well that I would like to use the same pattern for the output side,
> where I need d2i().
> I posted the DER dump below, but I don't know how to map that to the
> structures that the openssl macros can consume.

If you want a generalized parser, you need the schema.  Yes, you could make an ASN1 structure to parse THAT input, but if you want to parse all input of that type, you need to know about optional values, arbitrary repeats, etc.  The schema would specify all of that.

More information about the openssl-users mailing list