X-Git-Url: http://www.git.cypherpunks.ru/?p=pyderasn.git;a=blobdiff_plain;f=tests%2Ftest_crts.py;h=8f8f1ec7b98c164a860a3087d2353573ea83685d;hp=5a839eb4d0059a1edf7d22056354226a9cd576ea;hb=b9b1e4187b0cd072dd1ccd1f34aa30232483d84d;hpb=1d553e0c1bbb7639409b846fe65711ca1fb00105 diff --git a/tests/test_crts.py b/tests/test_crts.py index 5a839eb..8f8f1ec 100644 --- a/tests/test_crts.py +++ b/tests/test_crts.py @@ -1,6 +1,6 @@ # coding: utf-8 # PyDERASN -- Python ASN.1 DER codec with abstract structures -# Copyright (C) 2017 Sergey Matveev +# Copyright (C) 2017-2018 Sergey Matveev # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License as @@ -37,6 +37,7 @@ from pyderasn import SequenceOf from pyderasn import SetOf from pyderasn import tag_ctxc from pyderasn import tag_ctxp +from pyderasn import TeletexString from pyderasn import UTCTime @@ -88,9 +89,22 @@ class AttributeValue(Any): pass +class OrganizationName(Choice): + schema = ( + ('printableString', PrintableString()), + ('teletexString', TeletexString()), + ) + + class AttributeTypeAndValue(Sequence): schema = ( - ("type", AttributeType()), + ("type", AttributeType(defines=("value", { + ObjectIdentifier("2.5.4.6"): PrintableString(), + ObjectIdentifier("2.5.4.8"): PrintableString(), + ObjectIdentifier("2.5.4.7"): PrintableString(), + ObjectIdentifier("2.5.4.10"): OrganizationName(), + ObjectIdentifier("2.5.4.3"): PrintableString(), + }))), ("value", AttributeValue()), )