Introduction

Abstract Syntax Notation One (ASN.1) Distinguished Encoding Rule (DER) encoded data is widely used in digital security protocols (i.e. X509 digital certificate). The encoded data is not readable by regular text editors. The Asn1Processor Library is designed to parse and modify ASN.1 DER encoded data. The ASN.1 Editor is a sample project that uses the Asn1Processor library to view and to edit DER encoded data. The Asn1Processor Library source code and reference documentation (Asn1EditorLib.chm) are also included in the downloadable source code zip file.

The ASN.1 Editor doesn't do any schema checking. The user needs to make sure the edited data conforms to certain constrains (i.e. OCSP request or Key Info structure).

Share

About the Author

Liping Dai has worked in IT industry more than 17 years. He moved to Canada in 1996. After worked in Toronto for 4 years, he relocated to Silicon Valley. He has strong passion in the area of Multi-core/Multi thread programming, Parallel Computing, Image Reorganization, Secure Communication, and Mobile Device development.

I found a problem when processing a PKCS10 generated by a microsoft tool. A UTF8 string was empty, and the ASN.1 Editor could not display this file. It can be fixed by making this change in Asn1Node.cs:

I have created a Visualizer for Visual Studio based in your editor (but with my own implementation of the decoding, as i only needed reading the data, not creating). (It's at ASN1 Visualizer for Visual Studio 2008[^])
I would like your opinion if you can look at it for a moment (the article is not complete tho)
Also, if you feel that something is wrong with the way i used your code (licensing, copyright or something like that, plz let me know).
Thanks for all the work you put into this editor, it really helped me over the last year.

Hi,
sorry for my english, I don't speak so good!
I have my request in txt format
(the request is for example:
SEQUENCE {
OBJECT IDENTIFIER signedData (1 2 840 113549 1 7 2)
[0] {
SEQUENCE { ....
)
and I want to convert this text file in Base64 and in DER.
When I have DER File, I have to send with a httpwebrequest.

The ASN.1 Editor doesn’t have the functionality to convert your text to DER file. You need to generate the DER data manually with the editor or you could do it by other programs. The data converter can help you convert the DER file into Base64 text.

In a thread on April 03, I spoke about two new functions for ASN.1 Editor.
Initially, I spoke about passing a filename as an argument (so that I can right-click Open With) to the editor and have it opened. I vaguely recall downloading a version of ASN.1 Editor with this functionality. I then suggested perhaps to display the open file in the title bar of the window so that I know which file I have open. I download the latest version and the functionality for opening a file as a command line argument has disappeared - perhaps you have updated the wrong version?
Apologies if I have made a mistake somewhere.

Sorry for the late reply. Somehow I didn’t receive the notification email from your posting; so I just got to know your question.

The library didn’t really implement the encoding routine to encode integer number. The editor only accepts a hex string as the integer content. The only thing the library does is calculating the data length and adjusts all the parent node data length. The library doesn’t verify the input data that included in the hex string.

You can provide “00” hex string as the integer value input to the editor. It will be encoded as “02 01 00”; which also means you need to set the integer node value to “00” after the new node is created by the library.

Yes, I still keep maintaining the project. Somehow, I got several requests for adding the command line support for the ASN.1 Editor. I just completed the minimal command line support for opening the binary and PEM formatted file this weekend. Here is the update URL: http://lipingshare.com/Asn1Editor/

The reason for putting the updates on my site is I can update it very quickly and easily. Also, I want to keep the update history a while. I will consider sending a stabilized version to CodeProject for updating the source here after sometime.