ASN.1 Editor  

Author: Liping Dai

The last source code update date: 09/29/2008
Web: www.lipingshare.com/Asn1Editor
Email: LipingShare@yahoo.com
Download Setup File: Asn1EditorSetup.msi
Download Source Code: Asn1EditorSource.zip
Asn1Processor Library Reference: Asn1EditorLib.chm

Run Time Environment
Windows: 2000, XP, 2003
.Net Framework: 1.1

Table of Content

  1. Introduction
  2. Main View
  3. Main Features

·      Dump Text Format Data

·        Atomically Parse “encapsulates” data

·        Hex Data Viewer

·        Extensible OID Table

·        Change Node Content

·        Save selected node data

·        Copy Selected Node Data into Clipboard

·        Paste Node from Clipboard

·        Binary/Hex/Base64 Data Converter

  1. Copyright and Permissions
  2. Update Information

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). 


Main View:

Main Features:

1. Dump text format data:

You can view the selected node branch text dump by right click the designated node and select “View Node Text”.

Text Viewer:

2. Atomically Parse “encapsulates” data

OCTET and BITSTRING may encapsulates ASN.1 DER encoded data, for example:

 ASN.1 Editor can automatically parse the data structure.

3. Hex Data Viewer

Click: View->Hex Viewer, you can view the binary data structure.

Hex Viewer:

 

4. Extensible OID Table

OID.txt file is installed in the same directory as Asn1Editor.EXE. 

Here is the sample records:

0.9.2342.19200300.100.1.25, domainComponent
1.2.36.68980861.1.1.10, Signet pilot
1.2.36.68980861.1.1.11, Signet intraNet
1.2.36.68980861.1.1.2, Signet personal
1.2.36.68980861.1.1.20, Signet securityPolicy

OID and the description are comma separated. It can be extend in order to add in additional OIDs.

5. Change Node Content

Double click the selected node you can see the "Node Content Editor".

Node Content Editor:

6. Save Selected Node Data

You can save designated node data into a file by right click the node and select "Save selected node as...".

7. Copy Selected Node Data into Clipboard

Right click the node and select "Copy".

8. Paste Node from Clipboard

Right click the insert point node and select "Paste as last child node", "Paste before current node", or "Paste after current node" to perform the insert operation.

9. Binary/Hex/Base64 Data Converter

Converting the data format between Hex, Base64, and PEM by the "Data Converter".

Data Converter:

   

Copyright and Permissions:

Copyright (c) 2003 Liping Dai. All rights reserved.
Web: www.lipingshare.com
Email: lipingshare@yahoo.com

Copyright and Permission Details:

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, and/or sell copies of the Software, subject to the following conditions: 

1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 

2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 

THE SOFTWARE PRODUCT IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF TITLE, NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.

Update Information:

09/29/2008 Update:
1. Changed registry entry from LocalMachine to CurrentUser.
2. Replaced simple string concatenation with string buffer operation to increase hex viewer performance. Thanks to Olexij Tkatchenko for the fixes.
Download Setup File: Asn1EditorSetup.msi
Download Source Code: Asn1EditorSource.zip
Asn1Processor Library Reference: Asn1EditorLib.chm

03/17/2007 Update:
1. Compiled by VS2005.
2. Screen positioning changes for supporting dual screens.
Download Setup File: Asn1EditorSetup.msi
Download Source Code: Asn1EditorSource.zip
Asn1Processor Library Reference: Asn1EditorLib.chm

07/03/2005 Update:
1. A bug is fixed in the node text viewer to let the saved parameters take effect.
Download Setup File: Asn1EditorSetup.msi

Download Source Code: Asn1EditorSource.zip
Asn1Processor Library Reference: Asn1EditorLib.chm

06/28/2005 Update:
1. OID table uniqueness checking and sorting when the OID text file is first used.
2. Removed unnecessary references from Asn1Parser and Asn1Node class;
for example "using System.Windows.Forms;"
3. Added Configuration class to save some of the editor settings;
for example the last editor winddow position, size, hex viewer state, and text viewer state.
4. Added the application friendly name in the registry to have better "open with" support.
5. Added Asn1Editor.Configuration class to save some screen related information.

6. Zero length bit-string decoding bug fix. -- Thanks to Gustaf Björklund for fixing the bug.
Download Setup File: Asn1EditorSetup.msi
Download Source Code: Asn1EditorSource.zip
Asn1Processor Library Reference: Asn1EditorLib.chm

04/04/2005 Update:
1. Bug fix to display opening file name.
Thanks to Tony Morris for the bug report.
Download Setup File: Asn1EditorSetup.msi

Download Source Code: Asn1EditorSource.zip
Asn1Processor Library Reference: Asn1EditorLib.chm

04/02/2005 Update:
1. Supports one command line parameter to open the editing file.
Download Setup File: Asn1EditorSetup.msi

Download Source Code: Asn1EditorSource.zip
Asn1Processor Library Reference: Asn1EditorLib.chm

03/27/2005 Update:
1. Fixed the OID encoding leading zero(0x80) bug.
Thanks for the bug report.
Ref URL: http://www.codeproject.com/csharp/Asn1Editor.asp?msg=1068457#xx1068457xx
Download Setup File: Asn1EditorSetup.msi

Download Source Code: Asn1EditorSource.zip
Asn1Processor Library Reference: Asn1EditorLib.chm

03/16/2005 Update:
1. Extended the node content text editor content max length to unlimited.
2. Display GENERALIZED TIME correctly.
3. Support RELATIVE-OID.
4. Support customized node text length.
5. Resize the hex viewer together with the main window.
6. Extended the OID table to include the BIO OID.

Download Setup File: Asn1EditorSetup.msi
Download Source Code: Asn1EditorSource.zip
Asn1Processor Library Reference: Asn1EditorLib.chm

09/23/2004 Update:
Bug fix for the general string decoding.

Download Setup File: Asn1EditorSetup.msi
Download Source Code: Asn1EditorSource.zip
Asn1Processor Library Reference: Asn1EditorLib.chm

11/05/2003 Update:
Thanks to Xavier Monés for the bug report and suggestions.

1. Some changes are made to encod/decode UTF8 and BMP string correctly.
Download Setup File: Asn1EditorSetup.msi
Download Source Code: Asn1EditorSource.zip
Asn1Processor Library Reference: Asn1EditorLib.chm

10/10/2003 Update:
Thanks to Joe Hartford for the bug report and suggestions.

1. Asn1Node.Data always return the data that not include it's tag and length.
2. Asn1Node.ParseEncapsulatedData property is added to control parsing encapsulated data.
3. Asn1Parser.ParseEncapsulatedData is added to control encapsulated data parsing from the root.
4. ASN.1 Editor support "Parse encapsulated data" for each node and it's children.
5. Asn1Node.GetRawData() is added to return the same data as SaveData() do, but it return byte[] instead stream.

Download Setup File: Asn1EditorSetup.msi
Download Source Code: Asn1EditorSource.zip
Asn1Processor Library Reference: Asn1EditorLib.chm

10/06/2003 Update:
Thanks to Joe Hartford for the bug report and suggestions.

1. Bug fix for Asn1Util.DerLengthDecode function. It returns -2 instead throwing exception when meet indefinite length. Actually, this function should not throw exception because it will stop the parser to do further decoding.
2. Library name space is changed from LCLib to LipingShare.LCLib to avoid possible naming conflict.
Download Setup File: Asn1EditorSetup.msi

Download Source Code: Asn1EditorSource.zip
Asn1Processor Library Reference: Asn1EditorLib.chm

09/25/2003 Update
:
1. Tree view refreshing mechanism is improved to avoid screen flashing after editing node content.
2. Bug fix for Asn1Node.ListDecode function. The child node should be added after loading
3. Minor improvements.
Download Setup File: Asn1EditorSetup.msi

Download Source Code: Asn1EditorSource.zip
Asn1Processor Library Reference: Asn1EditorLib.chm

08/26/2003 Release:
Download Setup File: Asn1EditorSetup.msi
Download Source Code: Asn1EditorSource.zip
Asn1Processor Library Reference: Asn1EditorLib.chm