I've never written anything that does this. The way to do it would be to 
recursively decode the blob with an ANY.Template, read the tag, and then 
decode it again with the correct template as specified by the tag. It is 
generally not possible to figure out unknown structures, because 
implicit tagging hides the type. But practically you can usually make it 
work with some clever guessing. An excellent example of this is Peter 
Gutmann's dumpasn1, described on his home page 
http://www.cs.auckland.ac.nz/~pgut001/ .

fjolsvit wrote:

>How would one read in and parse a DER encoded file of unknown content, and 
>parse it to obtain the ASN1 structure? I've looked through the 
>org.mozilla.jss.asn1 javaDocs and feel a bit overwhelmed by the number of 
>classes available to me.  I suspect this problem has been solved 10^6 times 
>in C.  What I'd like to have is a tool similar to the certificate 
>informtion viewer in Mozilla. 
>


Reply via email to