Exemple #1
0
class RevRepContent(univ.Sequence):
    """
    RevRepContent ::= SEQUENCE {
         status       SEQUENCE SIZE (1..MAX) OF PKIStatusInfo,
         revCerts [0] SEQUENCE SIZE (1..MAX) OF CertId
                                             OPTIONAL,
         crls     [1] SEQUENCE SIZE (1..MAX) OF CertificateList
                                             OPTIONAL
     }
    """
    componentType = namedtype.NamedTypes(
        namedtype.NamedType(
            'status',
            univ.SequenceOf(componentType=PKIStatusInfo(),
                            sizeSpec=constraint.ValueSizeConstraint(1, MAX))),
        namedtype.OptionalNamedType(
            'revCerts',
            univ.SequenceOf(componentType=rfc4211.CertId()).subtype(
                sizeSpec=constraint.ValueSizeConstraint(1, MAX),
                explicitTag=tag.Tag(tag.tagClassContext,
                                    tag.tagFormatConstructed, 0))),
        namedtype.OptionalNamedType(
            'crls',
            univ.SequenceOf(componentType=rfc5280.CertificateList()).subtype(
                sizeSpec=constraint.ValueSizeConstraint(1, MAX),
                explicitTag=tag.Tag(tag.tagClassContext,
                                    tag.tagFormatConstructed, 1))))
Exemple #2
0
class CRLAnnContent(univ.SequenceOf):
    componentType = rfc5280.CertificateList()
Exemple #3
0
 def setUp(self):
     self.asn1Spec = rfc5280.CertificateList()
class OtherRevocationInfoFormat(univ.Sequence):
    pass


OtherRevocationInfoFormat.componentType = namedtype.NamedTypes(
    namedtype.NamedType('otherRevInfoFormat', univ.ObjectIdentifier()),
    namedtype.NamedType('otherRevInfo', univ.Any())
)


class RevocationInfoChoice(univ.Choice):
    pass


RevocationInfoChoice.componentType = namedtype.NamedTypes(
    namedtype.NamedType('crl', rfc5280.CertificateList()),
    namedtype.NamedType('other', OtherRevocationInfoFormat().subtype(
        implicitTag=tag.Tag(tag.tagClassContext, tag.tagFormatConstructed, 1)))
)


class RevocationInfoChoices(univ.SetOf):
    pass


RevocationInfoChoices.componentType = RevocationInfoChoice()


class OriginatorInfo(univ.Sequence):
    pass
Exemple #5
0
# ASN.1 source from:
# https://www.rfc-editor.org/rfc/rfc7296.txt

from pyasn1.type import namedtype
from pyasn1.type import tag
from pyasn1.type import univ

from pyasn1_modules import rfc5280


class CertificateOrCRL(univ.Choice):
    pass


CertificateOrCRL.componentType = namedtype.NamedTypes(
    namedtype.NamedType(
        'cert',
        rfc5280.Certificate().subtype(
            explicitTag=tag.Tag(tag.tagClassContext, tag.tagFormatSimple, 0))),
    namedtype.NamedType(
        'crl',
        rfc5280.CertificateList().subtype(
            explicitTag=tag.Tag(tag.tagClassContext, tag.tagFormatSimple, 1))))


class CertificateBundle(univ.SequenceOf):
    pass


CertificateBundle.componentType = CertificateOrCRL()