asn1editor


Nameasn1editor JSON
Version 0.8.0 PyPI version JSON
download
home_pagehttps://github.com/futsch1/asn1editor
SummaryASN.1 editor framework with support for encoding and decoding various codecs.
upload_time2023-08-21 20:46:41
maintainer
docs_urlNone
authorFlorian Fetz
requires_python>=3.6
licenseMIT
keywords asn.1 asn1 editor
VCS
bugtrack_url
requirements asn1tools wxpython coverage
Travis-CI No Travis.
coveralls test coverage
            ![Build](https://github.com/Futsch1/asn1editor/workflows/Build/badge.svg)
[![Coverage Status](https://coveralls.io/repos/github/Futsch1/asn1editor/badge.svg?branch=master)](https://coveralls.io/github/Futsch1/asn1editor?branch=master)
[![Maintainability](https://api.codeclimate.com/v1/badges/b2492b88948ace2e8a14/maintainability)](https://codeclimate.com/github/Futsch1/asn1editor/maintainability)
[![Documentation Status](https://readthedocs.org/projects/asn1editor/badge/?version=latest)](https://asn1editor.readthedocs.io/en/latest/?badge=latest)
# asn1editor
Python based ASN.1 editor

This project contains a generic editor to view and edit ASN.1 encoded data. 
It can load and save data encoded in various ASN.1 formats. It uses
[asn1tools](https://github.com/eerimoq/asn1tools) to parse
ASN.1 specifications and read and write encoded data.

The controller part of the editor is written independently of the 
used GUI framework. A view implementation with wxPython is provided.

![Screenshot](docs/screenshot_tree.png?raw=true "asn1editor")

## Usage
To start the wxPython based editor, install asn1editor via pip:

```pip install asn1editor```

Then you can run asn1editor from the shell

```asn1editor [-h] [-type TYPE] [-data DATA] [asn1spec]```

The ASN.1 specification to be loaded can be passed as an (optional) argument. The type inside the ASN.1 specification can be selected using the syntax < Module
name >.< Type name >. Finally, a data file can be passed as well that contains data encoded in the ASN.1 specification.

## Features

### Supported types
The editor supports a large variety of ASN.1 data types:
- INTEGER
- REAL
- ENUMERATED
- BOOLEAN
- OCTET STRING, VisibleString, UTF8String, GeneralString, IA5String, OBJECT IDENTIFIER
- BIT STRING
- SEQUENCE, SET
- SEQUENCE OF, SET OF
- CHOICE
- DATE, TIME-OF-DAY, DATE-TIME, GeneralizedTime, UTCTime

### Supported encodings
The following encodings are supported for reading and writing data:

- JER
- OER
- XER
- DER
- BER
- PER
- UPER

### GUI features
- Load and save encoded data
- View the data in a tree view or as groups

![Screenshot](docs/screenshot_groups.png?raw=true "asn1editor group view")
- See limits of numeric values and texts as tooltips
- Edit octet strings as ASCII or hex
- List of recently opened specifications for quick access

### IMPORTS
IMPORT references are automatically resolved if the ASN1 files containing the imported types 
reside in the same directory and have the extension ".asn". 

### Extending asn1editor

If you want to extend asn1editor with custom functionality, you can pass a plugin object to the WxPythonMainWindow object.
The plugin object needs to inherit from asn1editor.Plugin.

Example:

```python
import wx
from asn1editor import WxPythonMainWindow, Plugin

class MyPlugin(Plugin):
    # Implementation of abstract functions goes here
    pass

app = wx.App()

frame = WxPythonMainWindow([MyPlugin()])

frame.Show()

app.MainLoop()
```

## Plugin interface

In order to use custom data formats or to work with the data, plugins can be used. These plugins need to inherit from the Plugin.Plugin class and can use the
PluginInterface.PluginInterface class to interact with the main application. A list of plugins can be passed to the constructor of the main editor class and is
then automatically embedded in the application.

An example application is if a custom header is added to an ASN.1 encoded data. Then the plugin can decode the header, choose the appropriate ASN.1
specification, load it, decode the data and display it.

## Type augmenter

The editor can be customized to modify the display of certain fields. This customization is provided via a class that implements the TypeAugmenter interface.
The editor will query additional information for every field via this interface. Currently, a field can be augmented by providing a help text and a style
IntEnum. The help text will be shown in the tooltip of each field and the style flag modifies the way how a field is displayed. A field can be hidden or be
declared as read-only.

The editor comes with a default implementation of this augmenter that uses a .style file to customize the way fields are displayed in asn1editor.

If an ASN.1 file is opened, asn1editor looks for an equally named file with a .style extension in the same directory. If it is found, it is loaded and used to
refine the layout of the specification. A style file is in JSON format and contains the name of the ASN.1 field as a key, and the layout specifier as value. The
specifiers are named "read_only" and "hidden".

Example:

  ```json
  {
  "firstField": "read_only",
  "secondField": "hidden"
}
  ```

## Tests

Apart from unit tests in the source folder, there is a project on testquality.com that contains a number of manual tests to qualify an asn1editor
release [here](https://futsch1.testquality.com). You can log in using the credentials futsch1@fehlbar.de/readonly to view the test cases and test results.

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/futsch1/asn1editor",
    "name": "asn1editor",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.6",
    "maintainer_email": "",
    "keywords": "ASN.1,asn1,editor",
    "author": "Florian Fetz",
    "author_email": "florian.fetz@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/fa/62/981b94d13fd11a6faf7eb1d8222b93a5b87add162877c8e493af72e277cb/asn1editor-0.8.0.tar.gz",
    "platform": null,
    "description": "![Build](https://github.com/Futsch1/asn1editor/workflows/Build/badge.svg)\n[![Coverage Status](https://coveralls.io/repos/github/Futsch1/asn1editor/badge.svg?branch=master)](https://coveralls.io/github/Futsch1/asn1editor?branch=master)\n[![Maintainability](https://api.codeclimate.com/v1/badges/b2492b88948ace2e8a14/maintainability)](https://codeclimate.com/github/Futsch1/asn1editor/maintainability)\n[![Documentation Status](https://readthedocs.org/projects/asn1editor/badge/?version=latest)](https://asn1editor.readthedocs.io/en/latest/?badge=latest)\n# asn1editor\nPython based ASN.1 editor\n\nThis project contains a generic editor to view and edit ASN.1 encoded data. \nIt can load and save data encoded in various ASN.1 formats. It uses\n[asn1tools](https://github.com/eerimoq/asn1tools) to parse\nASN.1 specifications and read and write encoded data.\n\nThe controller part of the editor is written independently of the \nused GUI framework. A view implementation with wxPython is provided.\n\n![Screenshot](docs/screenshot_tree.png?raw=true \"asn1editor\")\n\n## Usage\nTo start the wxPython based editor, install asn1editor via pip:\n\n```pip install asn1editor```\n\nThen you can run asn1editor from the shell\n\n```asn1editor [-h] [-type TYPE] [-data DATA] [asn1spec]```\n\nThe ASN.1 specification to be loaded can be passed as an (optional) argument. The type inside the ASN.1 specification can be selected using the syntax < Module\nname >.< Type name >. Finally, a data file can be passed as well that contains data encoded in the ASN.1 specification.\n\n## Features\n\n### Supported types\nThe editor supports a large variety of ASN.1 data types:\n- INTEGER\n- REAL\n- ENUMERATED\n- BOOLEAN\n- OCTET STRING, VisibleString, UTF8String, GeneralString, IA5String, OBJECT IDENTIFIER\n- BIT STRING\n- SEQUENCE, SET\n- SEQUENCE OF, SET OF\n- CHOICE\n- DATE, TIME-OF-DAY, DATE-TIME, GeneralizedTime, UTCTime\n\n### Supported encodings\nThe following encodings are supported for reading and writing data:\n\n- JER\n- OER\n- XER\n- DER\n- BER\n- PER\n- UPER\n\n### GUI features\n- Load and save encoded data\n- View the data in a tree view or as groups\n\n![Screenshot](docs/screenshot_groups.png?raw=true \"asn1editor group view\")\n- See limits of numeric values and texts as tooltips\n- Edit octet strings as ASCII or hex\n- List of recently opened specifications for quick access\n\n### IMPORTS\nIMPORT references are automatically resolved if the ASN1 files containing the imported types \nreside in the same directory and have the extension \".asn\". \n\n### Extending asn1editor\n\nIf you want to extend asn1editor with custom functionality, you can pass a plugin object to the WxPythonMainWindow object.\nThe plugin object needs to inherit from asn1editor.Plugin.\n\nExample:\n\n```python\nimport wx\nfrom asn1editor import WxPythonMainWindow, Plugin\n\nclass MyPlugin(Plugin):\n    # Implementation of abstract functions goes here\n    pass\n\napp = wx.App()\n\nframe = WxPythonMainWindow([MyPlugin()])\n\nframe.Show()\n\napp.MainLoop()\n```\n\n## Plugin interface\n\nIn order to use custom data formats or to work with the data, plugins can be used. These plugins need to inherit from the Plugin.Plugin class and can use the\nPluginInterface.PluginInterface class to interact with the main application. A list of plugins can be passed to the constructor of the main editor class and is\nthen automatically embedded in the application.\n\nAn example application is if a custom header is added to an ASN.1 encoded data. Then the plugin can decode the header, choose the appropriate ASN.1\nspecification, load it, decode the data and display it.\n\n## Type augmenter\n\nThe editor can be customized to modify the display of certain fields. This customization is provided via a class that implements the TypeAugmenter interface.\nThe editor will query additional information for every field via this interface. Currently, a field can be augmented by providing a help text and a style\nIntEnum. The help text will be shown in the tooltip of each field and the style flag modifies the way how a field is displayed. A field can be hidden or be\ndeclared as read-only.\n\nThe editor comes with a default implementation of this augmenter that uses a .style file to customize the way fields are displayed in asn1editor.\n\nIf an ASN.1 file is opened, asn1editor looks for an equally named file with a .style extension in the same directory. If it is found, it is loaded and used to\nrefine the layout of the specification. A style file is in JSON format and contains the name of the ASN.1 field as a key, and the layout specifier as value. The\nspecifiers are named \"read_only\" and \"hidden\".\n\nExample:\n\n  ```json\n  {\n  \"firstField\": \"read_only\",\n  \"secondField\": \"hidden\"\n}\n  ```\n\n## Tests\n\nApart from unit tests in the source folder, there is a project on testquality.com that contains a number of manual tests to qualify an asn1editor\nrelease [here](https://futsch1.testquality.com). You can log in using the credentials futsch1@fehlbar.de/readonly to view the test cases and test results.\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "ASN.1 editor framework with support for encoding and decoding various codecs.",
    "version": "0.8.0",
    "project_urls": {
        "Homepage": "https://github.com/futsch1/asn1editor"
    },
    "split_keywords": [
        "asn.1",
        "asn1",
        "editor"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "26d1289af59dab24e1662cf46d9c74e7b3f65e74da5c755dd441d3577793d4fe",
                "md5": "908347d25918d9d685e1174c1397b135",
                "sha256": "59fc62f513a7b37481f4490d55b461b242191ba069736f61eed05e45e22589c2"
            },
            "downloads": -1,
            "filename": "asn1editor-0.8.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "908347d25918d9d685e1174c1397b135",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.6",
            "size": 62553,
            "upload_time": "2023-08-21T20:46:39",
            "upload_time_iso_8601": "2023-08-21T20:46:39.672327Z",
            "url": "https://files.pythonhosted.org/packages/26/d1/289af59dab24e1662cf46d9c74e7b3f65e74da5c755dd441d3577793d4fe/asn1editor-0.8.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "fa62981b94d13fd11a6faf7eb1d8222b93a5b87add162877c8e493af72e277cb",
                "md5": "d3dcb60a6428547fbe84c2ef2f3c7624",
                "sha256": "0b4110947a712a13b7ebc8dba46cc57e8254ea3f305443a1139c5a130ae568b7"
            },
            "downloads": -1,
            "filename": "asn1editor-0.8.0.tar.gz",
            "has_sig": false,
            "md5_digest": "d3dcb60a6428547fbe84c2ef2f3c7624",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.6",
            "size": 45380,
            "upload_time": "2023-08-21T20:46:41",
            "upload_time_iso_8601": "2023-08-21T20:46:41.368649Z",
            "url": "https://files.pythonhosted.org/packages/fa/62/981b94d13fd11a6faf7eb1d8222b93a5b87add162877c8e493af72e277cb/asn1editor-0.8.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-08-21 20:46:41",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "futsch1",
    "github_project": "asn1editor",
    "travis_ci": false,
    "coveralls": true,
    "github_actions": true,
    "requirements": [
        {
            "name": "asn1tools",
            "specs": []
        },
        {
            "name": "wxpython",
            "specs": [
                [
                    ">=",
                    "4.1.0"
                ]
            ]
        },
        {
            "name": "coverage",
            "specs": []
        }
    ],
    "lcname": "asn1editor"
}
        
Elapsed time: 0.10596s