# coding: utf-8
# PyGOST -- Pure Python GOST cryptographic functions library
-# Copyright (C) 2015-2020 Sergey Matveev <stargrave@stargrave.org>
+# Copyright (C) 2015-2021 Sergey Matveev <stargrave@stargrave.org>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
bounds = (1, float("+inf"))
+class CertificateChoices(Choice):
+ schema = (
+ ("certificate", Certificate()),
+ # ("extendedCertificate", OctetString(impl=tag_ctxp(0))),
+ # ("v1AttrCert", AttributeCertificateV1(impl=tag_ctxc(1))), # V1 is osbolete
+ # ("v2AttrCert", AttributeCertificateV2(impl=tag_ctxc(2))),
+ # ("other", OtherCertificateFormat(impl=tag_ctxc(3))),
+ )
+
+
+class CertificateSet(SetOf):
+ schema = CertificateChoices()
+
+
+class OriginatorInfo(Sequence):
+ schema = (
+ ("certs", CertificateSet(impl=tag_ctxc(0), optional=True)),
+ # ("crls", RevocationInfoChoices(impl=tag_ctxc(1), optional=True)),
+ )
+
+
class EnvelopedData(Sequence):
schema = (
("version", CMSVersion()),
- # ("originatorInfo", OriginatorInfo(impl=tag_ctxc(0), optional=True)),
+ ("originatorInfo", OriginatorInfo(impl=tag_ctxc(0), optional=True)),
("recipientInfos", RecipientInfos()),
("encryptedContentInfo", EncryptedContentInfo()),
("unprotectedAttrs", UnprotectedAttributes(impl=tag_ctxc(1), optional=True)),