Пример #1
0
 def setUp(self):
     self.asn1Spec = rfc5280.Certificate()
Пример #2
0
OtherCertificateFormat.componentType = namedtype.NamedTypes(
    namedtype.NamedType('otherCertFormat', univ.ObjectIdentifier()),
    namedtype.NamedType('otherCert',
                        univ.Any(),
                        openType=opentype.OpenType('otherCertFormat',
                                                   otherCertFormatMap)))


class ExtendedCertificateInfo(univ.Sequence):
    pass


ExtendedCertificateInfo.componentType = namedtype.NamedTypes(
    namedtype.NamedType('version', CMSVersion()),
    namedtype.NamedType('certificate', rfc5280.Certificate()),
    namedtype.NamedType('attributes', UnauthAttributes()))


class Signature(univ.BitString):
    pass


class SignatureAlgorithmIdentifier(rfc5280.AlgorithmIdentifier):
    pass


class ExtendedCertificate(univ.Sequence):
    pass

Пример #3
0
class PkiPath(univ.SequenceOf):
    componentType = rfc5280.Certificate()
    subtypeSpec = constraint.ValueSizeConstraint(1, MAX)
Пример #4
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()