From 9c7c8907058265e037945fd96c77aeceb4902623 Mon Sep 17 00:00:00 2001 From: Sergey Matveev Date: Sat, 5 Jan 2019 14:10:11 +0300 Subject: [PATCH] Limitations section --- doc/features.rst | 8 +++----- doc/index.rst | 1 + doc/limitations.rst | 12 ++++++++++++ pyderasn.py | 12 ++++++++---- 4 files changed, 24 insertions(+), 9 deletions(-) create mode 100644 doc/limitations.rst diff --git a/doc/features.rst b/doc/features.rst index fd05f84..19cf7f9 100644 --- a/doc/features.rst +++ b/doc/features.rst @@ -3,8 +3,8 @@ 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 (no - BER), GeneralizedTime (no BER), CHOICE, ANY, SEQUENCE (OF), SET (OF) + STRING, NULL, OBJECT IDENTIFIER, ENUMERATED, all strings, UTCTime, + GeneralizedTime, CHOICE, ANY, SEQUENCE (OF), SET (OF) * Size :ref:`constraints ` checking * Working with sequences as high level data objects with ability to (un)marshall them @@ -43,6 +43,4 @@ practice it should be relatively easy to convert ``pyasn1``'s code to There are drawbacks: * No old Python versions support -* Strings are not validated in any way, except just trying to be decoded - in ``ascii``, ``iso-8859-1``, ``utf-8/16/32`` correspondingly -* No REAL, RELATIVE OID, EXTERNAL, INSTANCE OF, EMBEDDED PDV, CHARACTER STRING +* See :ref:`limitations ` diff --git a/doc/index.rst b/doc/index.rst index d1fca18..fa9f862 100644 --- a/doc/index.rst +++ b/doc/index.rst @@ -28,6 +28,7 @@ licenced under `GNU LGPLv3+ `__. :maxdepth: 1 features + limitations examples reference news diff --git a/doc/limitations.rst b/doc/limitations.rst new file mode 100644 index 0000000..d52b87b --- /dev/null +++ b/doc/limitations.rst @@ -0,0 +1,12 @@ +.. _limitations: + +Limitations +=========== + +* Strings (except :py:class:`pyderasn.NumericString` and + :py:class:`pyderasn.PrintableString`) are not validated + in any way, except just trying to be decoded in ``ascii``, + ``iso-8859-1``, ``utf-8/16/32`` correspondingly +* :py:class:`pyderasn.UTCTime` and :py:class:`pyderasn.GeneralizedTime` + support only DER-encoding +* No REAL, RELATIVE OID, EXTERNAL, INSTANCE OF, EMBEDDED PDV, CHARACTER STRING diff --git a/pyderasn.py b/pyderasn.py index c83b439..172c1f6 100755 --- a/pyderasn.py +++ b/pyderasn.py @@ -463,6 +463,10 @@ NumericString _____________ .. autoclass:: pyderasn.NumericString +PrintableString +_______________ +.. autoclass:: pyderasn.PrintableString + UTCTime _______ .. autoclass:: pyderasn.UTCTime @@ -3579,7 +3583,7 @@ class NumericString(AllowableCharsMixin, CommonString): be stored. >>> NumericString().allowable_chars - set(['3', '4', '7', '5', '1', '0', '8', '9', ' ', '6', '2']) + frozenset(['0', '1', '2', '3', '4', '5', '6', '7', '8', '9', ' ']) """ __slots__ = () tag_default = tag_encode(18) @@ -3600,7 +3604,7 @@ class PrintableString(AllowableCharsMixin, CommonString): Its value is properly sanitized: see X.680 41.4 table 10. >>> PrintableString().allowable_chars - >>> set([' ', "'", ..., 'z']) + frozenset([' ', "'", ..., 'z']) """ __slots__ = () tag_default = tag_encode(19) @@ -3664,7 +3668,7 @@ class UTCTime(CommonString): .. warning:: - No BER encodings are supported. Only DER. + BER encoding is unsupported. """ __slots__ = () tag_default = tag_encode(23) @@ -3818,7 +3822,7 @@ class GeneralizedTime(UTCTime): .. warning:: - No BER encodings are supported. Only DER. + BER encoding is unsupported. .. warning:: -- 2.44.0