X-Git-Url: http://www.git.cypherpunks.ru/?a=blobdiff_plain;f=doc%2Ffeatures.rst;h=fa1f3d6a90930bedcd9ecb457f151965d4f95929;hb=e106d9023d35c641f3b22b6d6612723c31b95ee3;hp=4d94324aedfb6a5e03d9628e0c1bacea3111db9a;hpb=664822cb0fc85360a5f77d93ed54714c42557c74;p=pyderasn.git diff --git a/doc/features.rst b/doc/features.rst index 4d94324..fa1f3d6 100644 --- a/doc/features.rst +++ b/doc/features.rst @@ -1,13 +1,14 @@ Features ======== +* BER/CER/DER decoding, DER encoding * Basic ASN.1 data types (X.208): BOOLEAN, INTEGER, BIT STRING, OCTET STRING, NULL, OBJECT IDENTIFIER, ENUMERATED, all strings, UTCTime, GeneralizedTime, CHOICE, ANY, SEQUENCE (OF), SET (OF) -* Size constraints checking +* Size :ref:`constraints ` checking * Working with sequences as high level data objects with ability to (un)marshall them -* Python 2.7/3.5 compatibility +* Python 2.7/3.5/3.6 compatibility Why yet another library? `pyasn1 `__ had all of this a long time ago. PyDERASN resembles it in many ways. In @@ -15,32 +16,36 @@ practice it should be relatively easy to convert ``pyasn1``'s code to ``pyderasn``'s one. But additionally it offers: * Small, simple and trying to be reviewable code. Just a single file -* ``__slots__`` friendliness -* Ability to know exact decoded objects offsets and lengths in the binary -* Pretty printer and command-line decoder, that could conveniently - replace utilities like either ``dumpasn1`` or ``openssl asn1parse`` +* Automatic decoding of :ref:`DEFINED BY ` fields +* Ability to know :ref:`exact decoded ` objects offsets and + lengths inside the binary +* :ref:`Pretty printer ` and command-line decoder, that could + conveniently replace utilities like either ``dumpasn1`` or + ``openssl asn1parse`` * Some kind of strong typing: SEQUENCEs require the exact **type** of settable values, even when they are inherited * However they do not require tags matching: IMPLICIT/EXPLICIT tags will be set automatically in the given sequence +* Descriptive errors, like ``pyderasn.DecodeError: UTCTime + (tbsCertificate.validity.notAfter.utcTime) (at 328) invalid UTCTime format`` +* ``__slots__`` friendliness * Could be significantly faster. For example parsing of CACert.org's CRL under Python 3.5.2: - :``pyderasn.py revoke.crl``: - ~2 min - :``pyderasn.py --schema path.to.CertificateList revoke.crl``: - ~38 sec + :``python -m pyderasn revoke.crl``: + ~2 min (``pyderasn == 1.0``) + :``python -m pyderasn --schema path.to.CertificateList revoke.crl``: + ~38 sec (``pyderasn == 1.0``) :``pyasn1.decode(asn1Spec=pyasn1.CertificateList())``: ~22 min (``pyasn1 == 0.2.3``) There are drawbacks: * No old Python versions support -* No BER/CER support * PyDERASN does **not** have object recreation capable ``repr``-s:: pyderasn>>> repr(algo_id) - AlgorithmIdentifier SEQUENCE[OBJECT IDENTIFIER 1.3.14.3.2.26, [UNIV 5] ANY 0500 OPTIONAL] + AlgorithmIdentifier SEQUENCE[algorithm: OBJECT IDENTIFIER 1.3.14.3.2.26; parameters: [UNIV 5] ANY 0500 OPTIONAL] pyasn1>>> repr(algo_id) AlgorithmIdentifier().setComponents(ObjectIdentifier('1.3.14.3.2.26'), Any(hexValue='0500'))