asn1


Nameasn1 JSON
Version 2.7.0 PyPI version JSON
download
home_pagehttps://github.com/andrivet/python-asn1
SummaryPython-ASN1 is a simple ASN.1 encoder and decoder for Python 2.7+ and 3.5+.
upload_time2023-01-17 12:02:35
maintainer
docs_urlNone
authorSebastien Andrivet
requires_python
licenseBSD
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage
            

========
Overview
========

Python-ASN1 is a simple ASN.1 encoder and decoder for Python 2.7 and 3.5+.

Features
========

- Support BER (parser) and DER (parser and generator) encoding (except indefinite lengths)
- 100% python, compatible with version 2.7, 3.5 and higher
- Can be integrated by just including a file into your project


Dependencies
==============

Python-ASN1 relies on `Python-Future <https://python-future.org>`_ for Python 2 and 3 compatibility. To install Python-Future:

.. code-block:: sh

  pip install future


How to install Python-asn1
==========================

Install from PyPi with the following:

.. code-block:: sh

  pip install asn1

or download the repository from `GitHub <https://github.com/andrivet/python-asn1>`_ and install with the following:

.. code-block:: sh

  python setup.py install

You can also simply include ``asn1.py`` into your project.


How to use Python-asn1
======================

.. note:: You can find more detailed documentation on the `Usage`_ page.

.. _Usage: usage.rst

Encoding
--------

If you want to encode data and retrieve its DER-encoded representation, use code such as:

.. code-block:: python

  import asn1

  encoder = asn1.Encoder()
  encoder.start()
  encoder.write('1.2.3', asn1.Numbers.ObjectIdentifier)
  encoded_bytes = encoder.output()


Decoding
--------

If you want to decode ASN.1 from DER or BER encoded bytes, use code such as:

.. code-block:: python

  import asn1

  decoder = asn1.Decoder()
  decoder.start(encoded_bytes)
  tag, value = decoder.read()


Documentation
=============

The complete documentation is available on Read The Docs:

`python-asn1.readthedocs.io <https://python-asn1.readthedocs.io/en/latest/>`_


License
=======

Python-ASN1 is free software that is made available under the MIT license.
Consult the file LICENSE that is distributed together with this library for
the exact licensing terms.

Copyright
=========

The following people have contributed to Python-ASN1. Collectively they own the copyright of this software.

* Geert Jansen (geert@boskant.nl): `original implementation <https://github.com/geertj/python-asn1>`_.
* Sebastien Andrivet (sebastien@andrivet.com)

Changelog
=========

2.7.0 (2023-01-17)
------------------

* Add context manager support (thanks to Mastermind-U)

2.6.0 (2022-07-15)
------------------

* Add support for GeneralizedTime (thanks to vollkorntomate)

2.5.0 (2022-03-03)
------------------

* Fixes to BitString decoding and encoding of IA5String and UTCTime (thanks to 0xbf00)

2.4.2 (2021-10-29)
------------------

* Fix a minor mistake in the dump.py example
* Add Python 3.9 and 3.10

2.4.1 (2020-07-16)
------------------

* Fix #89 - Replace explicit references to enum34 by enum-compat

2.4.0 (2020-06-23)
------------------

* Fix #21 - Invalid decoding in non-Universal classes
* Fix #57 - Invalid encoding of non-Universal classes

2.3.1 (2020-04-06)
------------------

* No change in code, only in packaging and in texts (README, ...)

2.3.0 (2020-04-05)
------------------

* Tests: Replace nose by pytest
* Add Python 3.8, remove Python 3.4 support
* PR#26 (from rumbah): Add test for default (implicit) encoding types
* PR#25 (from thomwiggers): Attempt to support BIT STRING
* Fix wrong example code, see #27
* (from jcrowgey) Makes the package usable with pip install
* Remove support of Python 3.3 (some dependencies do not support 3.3)
* PR#15 (from ThePlasmaRailgun) Fix parsing of object identifier
* PR#10 (from robinleander): Allow user to determine decoding tagtype


2.2.0 (2017-10-30)
------------------

* Use "true" enums instead of classes. Use enun34 backport for old Python versions.

2.1.1 (2017-10-30)
------------------

* Fix a bug (#9): two's complement corner case with values such as -32769. Add new test cases to test them.

2.1.0 (2016-12-18)
------------------

* Add more documentation
* Use (simulated) enumerations
* Add Python 2.6 in automated checks and tests
* Add type hints (for static checking) and fix some code

2.0.0 (2016-12-16)
------------------

* First public release by Sebastien Andrivet
* Support both python 2 and 3 (with Python-Future)
* All strings are now in unicode
* Add more ASN.1 tags (like PrintableString)
* Fix errors in the example (dump.py)
* Code reorganization

0.9 (2011-05-18)
----------------

* Initial public release by Geert Jansen

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/andrivet/python-asn1",
    "name": "asn1",
    "maintainer": "",
    "docs_url": null,
    "requires_python": "",
    "maintainer_email": "",
    "keywords": "",
    "author": "Sebastien Andrivet",
    "author_email": "sebastien@andrivet.com",
    "download_url": "https://files.pythonhosted.org/packages/2a/9f/9a45cbf77edbf85006bbd6d0067cc87b6a9291e12b2c958d818132e7e04d/asn1-2.7.0.tar.gz",
    "platform": null,
    "description": "\n\n========\nOverview\n========\n\nPython-ASN1 is a simple ASN.1 encoder and decoder for Python 2.7 and 3.5+.\n\nFeatures\n========\n\n- Support BER (parser) and DER (parser and generator) encoding (except indefinite lengths)\n- 100% python, compatible with version 2.7, 3.5 and higher\n- Can be integrated by just including a file into your project\n\n\nDependencies\n==============\n\nPython-ASN1 relies on `Python-Future <https://python-future.org>`_ for Python 2 and 3 compatibility. To install Python-Future:\n\n.. code-block:: sh\n\n  pip install future\n\n\nHow to install Python-asn1\n==========================\n\nInstall from PyPi with the following:\n\n.. code-block:: sh\n\n  pip install asn1\n\nor download the repository from `GitHub <https://github.com/andrivet/python-asn1>`_ and install with the following:\n\n.. code-block:: sh\n\n  python setup.py install\n\nYou can also simply include ``asn1.py`` into your project.\n\n\nHow to use Python-asn1\n======================\n\n.. note:: You can find more detailed documentation on the `Usage`_ page.\n\n.. _Usage: usage.rst\n\nEncoding\n--------\n\nIf you want to encode data and retrieve its DER-encoded representation, use code such as:\n\n.. code-block:: python\n\n  import asn1\n\n  encoder = asn1.Encoder()\n  encoder.start()\n  encoder.write('1.2.3', asn1.Numbers.ObjectIdentifier)\n  encoded_bytes = encoder.output()\n\n\nDecoding\n--------\n\nIf you want to decode ASN.1 from DER or BER encoded bytes, use code such as:\n\n.. code-block:: python\n\n  import asn1\n\n  decoder = asn1.Decoder()\n  decoder.start(encoded_bytes)\n  tag, value = decoder.read()\n\n\nDocumentation\n=============\n\nThe complete documentation is available on Read The Docs:\n\n`python-asn1.readthedocs.io <https://python-asn1.readthedocs.io/en/latest/>`_\n\n\nLicense\n=======\n\nPython-ASN1 is free software that is made available under the MIT license.\nConsult the file LICENSE that is distributed together with this library for\nthe exact licensing terms.\n\nCopyright\n=========\n\nThe following people have contributed to Python-ASN1. Collectively they own the copyright of this software.\n\n* Geert Jansen (geert@boskant.nl): `original implementation <https://github.com/geertj/python-asn1>`_.\n* Sebastien Andrivet (sebastien@andrivet.com)\n\nChangelog\n=========\n\n2.7.0 (2023-01-17)\n------------------\n\n* Add context manager support (thanks to Mastermind-U)\n\n2.6.0 (2022-07-15)\n------------------\n\n* Add support for GeneralizedTime (thanks to vollkorntomate)\n\n2.5.0 (2022-03-03)\n------------------\n\n* Fixes to BitString decoding and encoding of IA5String and UTCTime (thanks to 0xbf00)\n\n2.4.2 (2021-10-29)\n------------------\n\n* Fix a minor mistake in the dump.py example\n* Add Python 3.9 and 3.10\n\n2.4.1 (2020-07-16)\n------------------\n\n* Fix #89 - Replace explicit references to enum34 by enum-compat\n\n2.4.0 (2020-06-23)\n------------------\n\n* Fix #21 - Invalid decoding in non-Universal classes\n* Fix #57 - Invalid encoding of non-Universal classes\n\n2.3.1 (2020-04-06)\n------------------\n\n* No change in code, only in packaging and in texts (README, ...)\n\n2.3.0 (2020-04-05)\n------------------\n\n* Tests: Replace nose by pytest\n* Add Python 3.8, remove Python 3.4 support\n* PR#26 (from rumbah): Add test for default (implicit) encoding types\n* PR#25 (from thomwiggers): Attempt to support BIT STRING\n* Fix wrong example code, see #27\n* (from jcrowgey) Makes the package usable with pip install\n* Remove support of Python 3.3 (some dependencies do not support 3.3)\n* PR#15 (from ThePlasmaRailgun) Fix parsing of object identifier\n* PR#10 (from robinleander): Allow user to determine decoding tagtype\n\n\n2.2.0 (2017-10-30)\n------------------\n\n* Use \"true\" enums instead of classes. Use enun34 backport for old Python versions.\n\n2.1.1 (2017-10-30)\n------------------\n\n* Fix a bug (#9): two's complement corner case with values such as -32769. Add new test cases to test them.\n\n2.1.0 (2016-12-18)\n------------------\n\n* Add more documentation\n* Use (simulated) enumerations\n* Add Python 2.6 in automated checks and tests\n* Add type hints (for static checking) and fix some code\n\n2.0.0 (2016-12-16)\n------------------\n\n* First public release by Sebastien Andrivet\n* Support both python 2 and 3 (with Python-Future)\n* All strings are now in unicode\n* Add more ASN.1 tags (like PrintableString)\n* Fix errors in the example (dump.py)\n* Code reorganization\n\n0.9 (2011-05-18)\n----------------\n\n* Initial public release by Geert Jansen\n",
    "bugtrack_url": null,
    "license": "BSD",
    "summary": "Python-ASN1 is a simple ASN.1 encoder and decoder for Python 2.7+ and 3.5+.",
    "version": "2.7.0",
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "70b9983c341cff02fb09a32be5635bf13030e02917d81499900815dae26b738e",
                "md5": "e092601c2a2cbbbe14b9fd0229b55276",
                "sha256": "feb01dee1f485ecc1b1c0b66762196baaad22c0e1c89861159413b28393fba33"
            },
            "downloads": -1,
            "filename": "asn1-2.7.0-py2.py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "e092601c2a2cbbbe14b9fd0229b55276",
            "packagetype": "bdist_wheel",
            "python_version": "py2.py3",
            "requires_python": null,
            "size": 10008,
            "upload_time": "2023-01-17T12:02:29",
            "upload_time_iso_8601": "2023-01-17T12:02:29.045670Z",
            "url": "https://files.pythonhosted.org/packages/70/b9/983c341cff02fb09a32be5635bf13030e02917d81499900815dae26b738e/asn1-2.7.0-py2.py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "2a9f9a45cbf77edbf85006bbd6d0067cc87b6a9291e12b2c958d818132e7e04d",
                "md5": "6c8d13a79629e210d28623a8f2d728c0",
                "sha256": "44c0fc3d28c6a926e4d4959ffbc1bccf37faf4dca07520ba2e9b1b5b36fe0bda"
            },
            "downloads": -1,
            "filename": "asn1-2.7.0.tar.gz",
            "has_sig": false,
            "md5_digest": "6c8d13a79629e210d28623a8f2d728c0",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 28975,
            "upload_time": "2023-01-17T12:02:35",
            "upload_time_iso_8601": "2023-01-17T12:02:35.148790Z",
            "url": "https://files.pythonhosted.org/packages/2a/9f/9a45cbf77edbf85006bbd6d0067cc87b6a9291e12b2c958d818132e7e04d/asn1-2.7.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-01-17 12:02:35",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "github_user": "andrivet",
    "github_project": "python-asn1",
    "travis_ci": false,
    "coveralls": true,
    "github_actions": true,
    "requirements": [],
    "tox": true,
    "lcname": "asn1"
}
        
Elapsed time: 0.02876s