Topic: Decoding ASN1
I would like to decode ASN1 from a binary encoded file (not a certificate) using wolfCrypt to do the heavy lifting for me. Based off of this post - https://www.wolfssl.com/better-asn-1-su … templates/ - it sounds like this can be done using templates.
Using an X509 cert as the example, it seems like this involves creating an array of type "ASNItem" ("x509CertASN" in asn.c) and using functions such as GetASN_Items()/GetASN_OID(). The issue is these functions are local for internal ASN processing.
Looking into asn_public.h, there are structs for "Asn1Item" and "Asn1" but no obvious functions to handle decoding. My best guess is that the wc_Asn1_PrintAll()/wc_Asn1_Print() functions could be used in some way as they facilitate parsing and save results in an "Asn1" object.
Is there a way to specify a template for how the ASN1 should look and have wolfCrypt parse it? Or parse the data and save it into an object so it could be compared after?
Thanks