X-Git-Url: http://www.git.cypherpunks.ru/?p=pygost.git;a=blobdiff_plain;f=pygost%2Fasn1schemas%2Fcms.py;h=c57f6f014e88267d332a002ba8b1c088d68859ea;hp=747b984b5b8e38b08029cb6b691967a05c703928;hb=69854a17b5ed9e7970acf34af1f478d8b27ef21e;hpb=8b136ad8da7da37736cf838e80024eeffe43722a diff --git a/pygost/asn1schemas/cms.py b/pygost/asn1schemas/cms.py index 747b984..c57f6f0 100644 --- a/pygost/asn1schemas/cms.py +++ b/pygost/asn1schemas/cms.py @@ -307,10 +307,31 @@ class UnprotectedAttributes(SetOf): 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)),