python-asn1
Port variant v14
Summary Simple ASN.1 encoder and decoder (3.14)
Package version 3.2.0
Homepage https://github.com/andrivet/python-asn1
Keywords python
Maintainer Python Automaton
License Not yet specified
Other variants v13
Ravenports Buildsheet | History
Ravensource Port Directory | History
Last modified 08 FEB 2026, 01:51:50 UTC
Port created 05 FEB 2019, 15:55:37 UTC
Subpackage Descriptions
single ======== 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 (including indefinite lengths) - 100% python, compatible with version 2.7, 3.5 and higher - Can be integrated by just including a file into your project - Support most common ASN.1 types including REAL (encoding and decoding). Dependencies ============== Python-ASN1 relies on `Python-Future `_ for Python 2 and 3 compatibility. To install Python-Future: .. code-block:: sh pip install future Python-ASN1 relies on [type hints]. For Python 2.7, a backport of the standard library typing module has to be installed: .. code-block:: sh pip install typing This is not necessary for Python 3.5 and higher since it is part of the standard library. How to install Python-asn1 ========================== Install from PyPi with the following: .. code-block:: sh pip install asn1 or download the repository from [GitHub] 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 `_ Contributing ============
Configuration Switches (platform-specific settings discarded)
PY313 OFF Build using Python 3.13 PY314 ON Build using Python 3.14
Package Dependencies by Type
Build (only) python314:dev:std
python-pip:single:v14
autoselect-python:single:std
Build and Runtime python314:primary:std
Download groups
main mirror://PYPIWHL/26/50/fed4dc9ac21c77ddbb7893093d4208c7da8a35b83b13ebb880b1633c3349
Distribution File Information
3c1788508d49f4f101c3c6b842b5a6d0fc9f68e2782e891d41af19bf321fedbb 17781 python-src/asn1-3.2.0-py2.py3-none-any.whl
Ports that require python-asn1:v14
No other ports depend on this one.