summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey Matveev <stargrave@stargrave.org>2019-09-04 15:39:00 +0300
committerSergey Matveev <stargrave@stargrave.org>2019-09-04 15:39:00 +0300
commit6f120959c33dd2297da042e28318375f905a8182 (patch)
tree9b7406a9118af062119c4e7fe2a2db84fcf566f9
parent625b774790181e5eb4021ee0fca961b7bac278f5 (diff)
downloadpygost-master.tar.xz
Partly supported ContentInfo.SignedData.certificatesHEADmaster
-rw-r--r--pygost/asn1schemas/cms.py17
1 files changed, 16 insertions, 1 deletions
diff --git a/pygost/asn1schemas/cms.py b/pygost/asn1schemas/cms.py
index f5e0a90..f168c1c 100644
--- a/pygost/asn1schemas/cms.py
+++ b/pygost/asn1schemas/cms.py
@@ -36,6 +36,7 @@ from pygost.asn1schemas.oids import id_signedData
from pygost.asn1schemas.oids import id_tc26_gost3410_2012_256
from pygost.asn1schemas.oids import id_tc26_gost3410_2012_512
from pygost.asn1schemas.x509 import AlgorithmIdentifier
+from pygost.asn1schemas.x509 import Certificate
from pygost.asn1schemas.x509 import SubjectPublicKeyInfo
@@ -270,12 +271,26 @@ class SignerInfos(SetOf):
schema = SignerInfo()
+class CertificateChoices(Choice):
+ schema = (
+ ('certificate', Certificate()),
+ # ('extendedCertificate', ExtendedCertificate(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 SignedData(Sequence):
schema = (
("version", CMSVersion()),
("digestAlgorithms", DigestAlgorithmIdentifiers()),
("encapContentInfo", EncapsulatedContentInfo()),
- # ("certificates", CertificateSet(impl=tag_ctxc(0), optional=True)),
+ ("certificates", CertificateSet(impl=tag_ctxc(0), optional=True)),
# ("crls", RevocationInfoChoices(impl=tag_ctxc(1), optional=True)),
("signerInfos", SignerInfos()),
)