2 # PyDERASN -- Python ASN.1 DER codec with abstract structures
3 # Copyright (C) 2017-2020 Sergey Matveev <stargrave@stargrave.org>
5 # This program is free software: you can redistribute it and/or modify
6 # it under the terms of the GNU Lesser General Public License as
7 # published by the Free Software Foundation, version 3 of the License.
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 # GNU Lesser General Public License for more details.
14 # You should have received a copy of the GNU Lesser General Public
15 # License along with this program. If not, see
16 # <http://www.gnu.org/licenses/>.
17 """CRL related schemes, just to test the performance with them
20 from pyderasn import BitString
21 from pyderasn import Sequence
22 from pyderasn import SequenceOf
23 from pyderasn import tag_ctxc
25 from tests.test_crts import AlgorithmIdentifier
26 from tests.test_crts import CertificateSerialNumber
27 from tests.test_crts import Extensions
28 from tests.test_crts import Name
29 from tests.test_crts import Time
30 from tests.test_crts import Version
33 class RevokedCertificate(Sequence):
35 ("userCertificate", CertificateSerialNumber()),
36 ("revocationDate", Time()),
37 ("crlEntryExtensions", Extensions(optional=True)),
41 class RevokedCertificates(SequenceOf):
42 schema = RevokedCertificate()
45 class TBSCertList(Sequence):
47 ("version", Version(optional=True)),
48 ("signature", AlgorithmIdentifier()),
50 ("thisUpdate", Time()),
51 ("nextUpdate", Time(optional=True)),
52 ("revokedCertificates", RevokedCertificates(optional=True)),
53 ("crlExtensions", Extensions(expl=tag_ctxc(0), optional=True)),
57 class CertificateList(Sequence):
59 ("tbsCertList", TBSCertList()),
60 ("signatureAlgorithm", AlgorithmIdentifier()),
61 ("signatureValue", BitString()),