A pure Python ASN.1 library. Supports dict and sets.
Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.
 
 
John-Mark Gurney 01d8efffd7 update to version 2.0.0 to break w/ the Python 2 version. il y a 4 ans
.gitignore ignore coverage file il y a 7 ans
Makefile make this work on python 3... il y a 4 ans
README.md update readme w/ python 3 support, and mention where to find python 2 il y a 4 ans
pasn1.py forgot to update copyright to 2020. il y a 4 ans
requirements.txt make this work on python 3... il y a 4 ans
setup.py update to version 2.0.0 to break w/ the Python 2 version. il y a 4 ans

README.md

PASN1

This is a simple library for doing marshalling of python objects that uses a profile/subset of ASN.1. This library is not designed to be a general ASN.1 parser, but designed to be super simple to use, and secure.

This library support Python 3. The git repo has a branch, python2 that maintains the latest support for Python 2.

The following python types are supported: bool, int (and long), bytes, null (as None), float, unicode (aka str), datetime, list, set and dict. If you need to serialize other types/instances, a coerce function maybe provided which is required to return the above string and an object implementing the correct methods. See the ASN1Coder’s init method’s doc string for more information.

ASN.1 has a number of different types of strings, but only UTF8String is used by this library. In order to support dict types, it uses the Private Constructed type 0. The contents are pairs of key value objects. bytes is mapped to the octet string type. The minimal encoding is used so that the same data will be encoded as the same string, similar to the ASN.1 DER encoding. The class ASN1Coder is available if the dict support is required to not be present.