[EXTERNAL] Re: IMPLEMENT_ASN1_FUNCTIONS tutorial or help
kgoldman at us.ibm.com
Tue Aug 17 22:08:18 UTC 2021
On 8/17/2021 12:57 PM, Sands, Daniel via openssl-users wrote:
>>>> 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
>> 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.
I don't need a generalized parser, and there is no schema. It's the output of an ISO standard HSM (a TPM). It doesn't change, so I just want to part that specific output.
The only variation is that the public key could be ECC.
Any clue on how to code that structure?
More information about the openssl-users