Ejemplo n.º 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)
            )
        )
    )
Ejemplo n.º 2
0
 def setUp(self):
     self.asn1Spec = rfc5280.CertificateList()
Ejemplo n.º 3
0

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


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
Ejemplo n.º 4
0
class CRLAnnContent(univ.SequenceOf):
    componentType = rfc5280.CertificateList()
Ejemplo n.º 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_alt_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()