Coverage for /pythoncovmergedfiles/medio/medio/usr/local/lib/python3.8/site-packages/pyasn1_modules/rfc3280.py: 100%
509 statements
« prev ^ index » next coverage.py v7.2.2, created at 2023-03-26 06:04 +0000
« prev ^ index » next coverage.py v7.2.2, created at 2023-03-26 06:04 +0000
1# coding: utf-8
2#
3# This file is part of pyasn1-modules software.
4#
5# Created by Stanisław Pitucha with asn1ate tool.
6# Copyright (c) 2005-2020, Ilya Etingof <etingof@gmail.com>
7# License: http://snmplabs.com/pyasn1/license.html
8#
9# Internet X.509 Public Key Infrastructure Certificate and Certificate
10# Revocation List (CRL) Profile
11#
12# ASN.1 source from:
13# http://www.ietf.org/rfc/rfc3280.txt
14#
15from pyasn1.type import char
16from pyasn1.type import constraint
17from pyasn1.type import namedtype
18from pyasn1.type import namedval
19from pyasn1.type import tag
20from pyasn1.type import univ
21from pyasn1.type import useful
23MAX = float('inf')
26def _OID(*components):
27 output = []
28 for x in tuple(components):
29 if isinstance(x, univ.ObjectIdentifier):
30 output.extend(list(x))
31 else:
32 output.append(int(x))
34 return univ.ObjectIdentifier(output)
37unformatted_postal_address = univ.Integer(16)
39ub_organizational_units = univ.Integer(4)
41ub_organizational_unit_name_length = univ.Integer(32)
44class OrganizationalUnitName(char.PrintableString):
45 pass
48OrganizationalUnitName.subtypeSpec = constraint.ValueSizeConstraint(1, ub_organizational_unit_name_length)
51class OrganizationalUnitNames(univ.SequenceOf):
52 pass
55OrganizationalUnitNames.componentType = OrganizationalUnitName()
56OrganizationalUnitNames.sizeSpec = constraint.ValueSizeConstraint(1, ub_organizational_units)
59class AttributeType(univ.ObjectIdentifier):
60 pass
63id_at = _OID(2, 5, 4)
65id_at_name = _OID(id_at, 41)
67ub_pds_parameter_length = univ.Integer(30)
70class PDSParameter(univ.Set):
71 pass
74PDSParameter.componentType = namedtype.NamedTypes(
75 namedtype.OptionalNamedType('printable-string', char.PrintableString().subtype(
76 subtypeSpec=constraint.ValueSizeConstraint(1, ub_pds_parameter_length))),
77 namedtype.OptionalNamedType('teletex-string', char.TeletexString().subtype(
78 subtypeSpec=constraint.ValueSizeConstraint(1, ub_pds_parameter_length)))
79)
82class PhysicalDeliveryOrganizationName(PDSParameter):
83 pass
86ub_organization_name_length = univ.Integer(64)
88ub_domain_defined_attribute_type_length = univ.Integer(8)
90ub_domain_defined_attribute_value_length = univ.Integer(128)
93class TeletexDomainDefinedAttribute(univ.Sequence):
94 pass
97TeletexDomainDefinedAttribute.componentType = namedtype.NamedTypes(
98 namedtype.NamedType('type', char.TeletexString().subtype(
99 subtypeSpec=constraint.ValueSizeConstraint(1, ub_domain_defined_attribute_type_length))),
100 namedtype.NamedType('value', char.TeletexString().subtype(
101 subtypeSpec=constraint.ValueSizeConstraint(1, ub_domain_defined_attribute_value_length)))
102)
104id_pkix = _OID(1, 3, 6, 1, 5, 5, 7)
106id_qt = _OID(id_pkix, 2)
109class PresentationAddress(univ.Sequence):
110 pass
113PresentationAddress.componentType = namedtype.NamedTypes(
114 namedtype.OptionalNamedType('pSelector', univ.OctetString().subtype(
115 explicitTag=tag.Tag(tag.tagClassContext, tag.tagFormatSimple, 0))),
116 namedtype.OptionalNamedType('sSelector', univ.OctetString().subtype(
117 explicitTag=tag.Tag(tag.tagClassContext, tag.tagFormatSimple, 1))),
118 namedtype.OptionalNamedType('tSelector', univ.OctetString().subtype(
119 explicitTag=tag.Tag(tag.tagClassContext, tag.tagFormatSimple, 2))),
120 namedtype.NamedType('nAddresses', univ.SetOf(componentType=univ.OctetString()).subtype(
121 explicitTag=tag.Tag(tag.tagClassContext, tag.tagFormatSimple, 3)))
122)
125class AlgorithmIdentifier(univ.Sequence):
126 pass
129AlgorithmIdentifier.componentType = namedtype.NamedTypes(
130 namedtype.NamedType('algorithm', univ.ObjectIdentifier()),
131 namedtype.OptionalNamedType('parameters', univ.Any())
132)
135class UniqueIdentifier(univ.BitString):
136 pass
139class Extension(univ.Sequence):
140 pass
143Extension.componentType = namedtype.NamedTypes(
144 namedtype.NamedType('extnID', univ.ObjectIdentifier()),
145 namedtype.DefaultedNamedType('critical', univ.Boolean().subtype(value=0)),
146 namedtype.NamedType('extnValue', univ.OctetString())
147)
150class Extensions(univ.SequenceOf):
151 pass
154Extensions.componentType = Extension()
155Extensions.sizeSpec = constraint.ValueSizeConstraint(1, MAX)
158class CertificateSerialNumber(univ.Integer):
159 pass
162class SubjectPublicKeyInfo(univ.Sequence):
163 pass
166SubjectPublicKeyInfo.componentType = namedtype.NamedTypes(
167 namedtype.NamedType('algorithm', AlgorithmIdentifier()),
168 namedtype.NamedType('subjectPublicKey', univ.BitString())
169)
172class Time(univ.Choice):
173 pass
176Time.componentType = namedtype.NamedTypes(
177 namedtype.NamedType('utcTime', useful.UTCTime()),
178 namedtype.NamedType('generalTime', useful.GeneralizedTime())
179)
182class Validity(univ.Sequence):
183 pass
186Validity.componentType = namedtype.NamedTypes(
187 namedtype.NamedType('notBefore', Time()),
188 namedtype.NamedType('notAfter', Time())
189)
192class Version(univ.Integer):
193 pass
196Version.namedValues = namedval.NamedValues(
197 ('v1', 0),
198 ('v2', 1),
199 ('v3', 2)
200)
203class AttributeValue(univ.Any):
204 pass
207class AttributeTypeAndValue(univ.Sequence):
208 pass
211AttributeTypeAndValue.componentType = namedtype.NamedTypes(
212 namedtype.NamedType('type', AttributeType()),
213 namedtype.NamedType('value', AttributeValue())
214)
217class RelativeDistinguishedName(univ.SetOf):
218 pass
221RelativeDistinguishedName.componentType = AttributeTypeAndValue()
222RelativeDistinguishedName.sizeSpec = constraint.ValueSizeConstraint(1, MAX)
225class RDNSequence(univ.SequenceOf):
226 pass
229RDNSequence.componentType = RelativeDistinguishedName()
232class Name(univ.Choice):
233 pass
236Name.componentType = namedtype.NamedTypes(
237 namedtype.NamedType('rdnSequence', RDNSequence())
238)
241class TBSCertificate(univ.Sequence):
242 pass
245TBSCertificate.componentType = namedtype.NamedTypes(
246 namedtype.DefaultedNamedType('version',
247 Version().subtype(explicitTag=tag.Tag(tag.tagClassContext,
248 tag.tagFormatSimple, 0)).subtype(value="v1")),
249 namedtype.NamedType('serialNumber', CertificateSerialNumber()),
250 namedtype.NamedType('signature', AlgorithmIdentifier()),
251 namedtype.NamedType('issuer', Name()),
252 namedtype.NamedType('validity', Validity()),
253 namedtype.NamedType('subject', Name()),
254 namedtype.NamedType('subjectPublicKeyInfo', SubjectPublicKeyInfo()),
255 namedtype.OptionalNamedType('issuerUniqueID', UniqueIdentifier().subtype(
256 implicitTag=tag.Tag(tag.tagClassContext, tag.tagFormatSimple, 1))),
257 namedtype.OptionalNamedType('subjectUniqueID', UniqueIdentifier().subtype(
258 implicitTag=tag.Tag(tag.tagClassContext, tag.tagFormatSimple, 2))),
259 namedtype.OptionalNamedType('extensions',
260 Extensions().subtype(explicitTag=tag.Tag(tag.tagClassContext, tag.tagFormatSimple, 3)))
261)
264class Certificate(univ.Sequence):
265 pass
268Certificate.componentType = namedtype.NamedTypes(
269 namedtype.NamedType('tbsCertificate', TBSCertificate()),
270 namedtype.NamedType('signatureAlgorithm', AlgorithmIdentifier()),
271 namedtype.NamedType('signature', univ.BitString())
272)
274ub_surname_length = univ.Integer(40)
277class TeletexOrganizationName(char.TeletexString):
278 pass
281TeletexOrganizationName.subtypeSpec = constraint.ValueSizeConstraint(1, ub_organization_name_length)
283ub_e163_4_sub_address_length = univ.Integer(40)
285teletex_common_name = univ.Integer(2)
287ub_country_name_alpha_length = univ.Integer(2)
289ub_country_name_numeric_length = univ.Integer(3)
292class CountryName(univ.Choice):
293 pass
296CountryName.tagSet = univ.Choice.tagSet.tagExplicitly(tag.Tag(tag.tagClassApplication, tag.tagFormatConstructed, 1))
297CountryName.componentType = namedtype.NamedTypes(
298 namedtype.NamedType('x121-dcc-code', char.NumericString().subtype(
299 subtypeSpec=constraint.ValueSizeConstraint(ub_country_name_numeric_length, ub_country_name_numeric_length))),
300 namedtype.NamedType('iso-3166-alpha2-code', char.PrintableString().subtype(
301 subtypeSpec=constraint.ValueSizeConstraint(ub_country_name_alpha_length, ub_country_name_alpha_length)))
302)
304extension_OR_address_components = univ.Integer(12)
306id_at_dnQualifier = _OID(id_at, 46)
308ub_e163_4_number_length = univ.Integer(15)
311class ExtendedNetworkAddress(univ.Choice):
312 pass
315ExtendedNetworkAddress.componentType = namedtype.NamedTypes(
316 namedtype.NamedType('e163-4-address', univ.Sequence(componentType=namedtype.NamedTypes(
317 namedtype.NamedType('number', char.NumericString().subtype(
318 subtypeSpec=constraint.ValueSizeConstraint(1, ub_e163_4_number_length)).subtype(
319 implicitTag=tag.Tag(tag.tagClassContext, tag.tagFormatSimple, 0))),
320 namedtype.OptionalNamedType('sub-address', char.NumericString().subtype(
321 subtypeSpec=constraint.ValueSizeConstraint(1, ub_e163_4_sub_address_length)).subtype(
322 implicitTag=tag.Tag(tag.tagClassContext, tag.tagFormatSimple, 1)))
323 ))
324 ),
325 namedtype.NamedType('psap-address', PresentationAddress().subtype(
326 implicitTag=tag.Tag(tag.tagClassContext, tag.tagFormatConstructed, 0)))
327)
329terminal_type = univ.Integer(23)
331id_domainComponent = _OID(0, 9, 2342, 19200300, 100, 1, 25)
333ub_state_name = univ.Integer(128)
336class X520StateOrProvinceName(univ.Choice):
337 pass
340X520StateOrProvinceName.componentType = namedtype.NamedTypes(
341 namedtype.NamedType('teletexString',
342 char.TeletexString().subtype(subtypeSpec=constraint.ValueSizeConstraint(1, ub_state_name))),
343 namedtype.NamedType('printableString',
344 char.PrintableString().subtype(subtypeSpec=constraint.ValueSizeConstraint(1, ub_state_name))),
345 namedtype.NamedType('universalString',
346 char.UniversalString().subtype(subtypeSpec=constraint.ValueSizeConstraint(1, ub_state_name))),
347 namedtype.NamedType('utf8String',
348 char.UTF8String().subtype(subtypeSpec=constraint.ValueSizeConstraint(1, ub_state_name))),
349 namedtype.NamedType('bmpString',
350 char.BMPString().subtype(subtypeSpec=constraint.ValueSizeConstraint(1, ub_state_name)))
351)
353ub_organization_name = univ.Integer(64)
356class X520OrganizationName(univ.Choice):
357 pass
360X520OrganizationName.componentType = namedtype.NamedTypes(
361 namedtype.NamedType('teletexString', char.TeletexString().subtype(
362 subtypeSpec=constraint.ValueSizeConstraint(1, ub_organization_name))),
363 namedtype.NamedType('printableString', char.PrintableString().subtype(
364 subtypeSpec=constraint.ValueSizeConstraint(1, ub_organization_name))),
365 namedtype.NamedType('universalString', char.UniversalString().subtype(
366 subtypeSpec=constraint.ValueSizeConstraint(1, ub_organization_name))),
367 namedtype.NamedType('utf8String',
368 char.UTF8String().subtype(subtypeSpec=constraint.ValueSizeConstraint(1, ub_organization_name))),
369 namedtype.NamedType('bmpString',
370 char.BMPString().subtype(subtypeSpec=constraint.ValueSizeConstraint(1, ub_organization_name)))
371)
373ub_emailaddress_length = univ.Integer(128)
376class ExtensionPhysicalDeliveryAddressComponents(PDSParameter):
377 pass
380id_at_surname = _OID(id_at, 4)
382ub_common_name_length = univ.Integer(64)
384id_ad = _OID(id_pkix, 48)
386ub_numeric_user_id_length = univ.Integer(32)
389class NumericUserIdentifier(char.NumericString):
390 pass
393NumericUserIdentifier.subtypeSpec = constraint.ValueSizeConstraint(1, ub_numeric_user_id_length)
396class OrganizationName(char.PrintableString):
397 pass
400OrganizationName.subtypeSpec = constraint.ValueSizeConstraint(1, ub_organization_name_length)
402ub_domain_name_length = univ.Integer(16)
405class AdministrationDomainName(univ.Choice):
406 pass
409AdministrationDomainName.tagSet = univ.Choice.tagSet.tagExplicitly(
410 tag.Tag(tag.tagClassApplication, tag.tagFormatConstructed, 2))
411AdministrationDomainName.componentType = namedtype.NamedTypes(
412 namedtype.NamedType('numeric', char.NumericString().subtype(
413 subtypeSpec=constraint.ValueSizeConstraint(0, ub_domain_name_length))),
414 namedtype.NamedType('printable', char.PrintableString().subtype(
415 subtypeSpec=constraint.ValueSizeConstraint(0, ub_domain_name_length)))
416)
419class PrivateDomainName(univ.Choice):
420 pass
423PrivateDomainName.componentType = namedtype.NamedTypes(
424 namedtype.NamedType('numeric', char.NumericString().subtype(
425 subtypeSpec=constraint.ValueSizeConstraint(1, ub_domain_name_length))),
426 namedtype.NamedType('printable', char.PrintableString().subtype(
427 subtypeSpec=constraint.ValueSizeConstraint(1, ub_domain_name_length)))
428)
430ub_generation_qualifier_length = univ.Integer(3)
432ub_given_name_length = univ.Integer(16)
434ub_initials_length = univ.Integer(5)
437class PersonalName(univ.Set):
438 pass
441PersonalName.componentType = namedtype.NamedTypes(
442 namedtype.NamedType('surname', char.PrintableString().subtype(
443 subtypeSpec=constraint.ValueSizeConstraint(1, ub_surname_length)).subtype(
444 implicitTag=tag.Tag(tag.tagClassContext, tag.tagFormatSimple, 0))),
445 namedtype.OptionalNamedType('given-name', char.PrintableString().subtype(
446 subtypeSpec=constraint.ValueSizeConstraint(1, ub_given_name_length)).subtype(
447 implicitTag=tag.Tag(tag.tagClassContext, tag.tagFormatSimple, 1))),
448 namedtype.OptionalNamedType('initials', char.PrintableString().subtype(
449 subtypeSpec=constraint.ValueSizeConstraint(1, ub_initials_length)).subtype(
450 implicitTag=tag.Tag(tag.tagClassContext, tag.tagFormatSimple, 2))),
451 namedtype.OptionalNamedType('generation-qualifier', char.PrintableString().subtype(
452 subtypeSpec=constraint.ValueSizeConstraint(1, ub_generation_qualifier_length)).subtype(
453 implicitTag=tag.Tag(tag.tagClassContext, tag.tagFormatSimple, 3)))
454)
456ub_terminal_id_length = univ.Integer(24)
459class TerminalIdentifier(char.PrintableString):
460 pass
463TerminalIdentifier.subtypeSpec = constraint.ValueSizeConstraint(1, ub_terminal_id_length)
465ub_x121_address_length = univ.Integer(16)
468class X121Address(char.NumericString):
469 pass
472X121Address.subtypeSpec = constraint.ValueSizeConstraint(1, ub_x121_address_length)
475class NetworkAddress(X121Address):
476 pass
479class BuiltInStandardAttributes(univ.Sequence):
480 pass
483BuiltInStandardAttributes.componentType = namedtype.NamedTypes(
484 namedtype.OptionalNamedType('country-name', CountryName()),
485 namedtype.OptionalNamedType('administration-domain-name', AdministrationDomainName()),
486 namedtype.OptionalNamedType('network-address', NetworkAddress().subtype(
487 implicitTag=tag.Tag(tag.tagClassContext, tag.tagFormatSimple, 0))),
488 namedtype.OptionalNamedType('terminal-identifier', TerminalIdentifier().subtype(
489 implicitTag=tag.Tag(tag.tagClassContext, tag.tagFormatSimple, 1))),
490 namedtype.OptionalNamedType('private-domain-name', PrivateDomainName().subtype(
491 explicitTag=tag.Tag(tag.tagClassContext, tag.tagFormatConstructed, 2))),
492 namedtype.OptionalNamedType('organization-name', OrganizationName().subtype(
493 implicitTag=tag.Tag(tag.tagClassContext, tag.tagFormatSimple, 3))),
494 namedtype.OptionalNamedType('numeric-user-identifier', NumericUserIdentifier().subtype(
495 implicitTag=tag.Tag(tag.tagClassContext, tag.tagFormatSimple, 4))),
496 namedtype.OptionalNamedType('personal-name', PersonalName().subtype(
497 implicitTag=tag.Tag(tag.tagClassContext, tag.tagFormatConstructed, 5))),
498 namedtype.OptionalNamedType('organizational-unit-names', OrganizationalUnitNames().subtype(
499 implicitTag=tag.Tag(tag.tagClassContext, tag.tagFormatSimple, 6)))
500)
502ub_domain_defined_attributes = univ.Integer(4)
505class BuiltInDomainDefinedAttribute(univ.Sequence):
506 pass
509BuiltInDomainDefinedAttribute.componentType = namedtype.NamedTypes(
510 namedtype.NamedType('type', char.PrintableString().subtype(
511 subtypeSpec=constraint.ValueSizeConstraint(1, ub_domain_defined_attribute_type_length))),
512 namedtype.NamedType('value', char.PrintableString().subtype(
513 subtypeSpec=constraint.ValueSizeConstraint(1, ub_domain_defined_attribute_value_length)))
514)
517class BuiltInDomainDefinedAttributes(univ.SequenceOf):
518 pass
521BuiltInDomainDefinedAttributes.componentType = BuiltInDomainDefinedAttribute()
522BuiltInDomainDefinedAttributes.sizeSpec = constraint.ValueSizeConstraint(1, ub_domain_defined_attributes)
524ub_extension_attributes = univ.Integer(256)
527class ExtensionAttribute(univ.Sequence):
528 pass
531ExtensionAttribute.componentType = namedtype.NamedTypes(
532 namedtype.NamedType('extension-attribute-type', univ.Integer().subtype(
533 subtypeSpec=constraint.ValueRangeConstraint(0, ub_extension_attributes)).subtype(
534 implicitTag=tag.Tag(tag.tagClassContext, tag.tagFormatSimple, 0))),
535 namedtype.NamedType('extension-attribute-value',
536 univ.Any().subtype(explicitTag=tag.Tag(tag.tagClassContext, tag.tagFormatSimple, 1)))
537)
540class ExtensionAttributes(univ.SetOf):
541 pass
544ExtensionAttributes.componentType = ExtensionAttribute()
545ExtensionAttributes.sizeSpec = constraint.ValueSizeConstraint(1, ub_extension_attributes)
548class ORAddress(univ.Sequence):
549 pass
552ORAddress.componentType = namedtype.NamedTypes(
553 namedtype.NamedType('built-in-standard-attributes', BuiltInStandardAttributes()),
554 namedtype.OptionalNamedType('built-in-domain-defined-attributes', BuiltInDomainDefinedAttributes()),
555 namedtype.OptionalNamedType('extension-attributes', ExtensionAttributes())
556)
558id_pe = _OID(id_pkix, 1)
560ub_title = univ.Integer(64)
563class X520Title(univ.Choice):
564 pass
567X520Title.componentType = namedtype.NamedTypes(
568 namedtype.NamedType('teletexString',
569 char.TeletexString().subtype(subtypeSpec=constraint.ValueSizeConstraint(1, ub_title))),
570 namedtype.NamedType('printableString',
571 char.PrintableString().subtype(subtypeSpec=constraint.ValueSizeConstraint(1, ub_title))),
572 namedtype.NamedType('universalString',
573 char.UniversalString().subtype(subtypeSpec=constraint.ValueSizeConstraint(1, ub_title))),
574 namedtype.NamedType('utf8String',
575 char.UTF8String().subtype(subtypeSpec=constraint.ValueSizeConstraint(1, ub_title))),
576 namedtype.NamedType('bmpString', char.BMPString().subtype(subtypeSpec=constraint.ValueSizeConstraint(1, ub_title)))
577)
579id_at_organizationalUnitName = _OID(id_at, 11)
582class EmailAddress(char.IA5String):
583 pass
586EmailAddress.subtypeSpec = constraint.ValueSizeConstraint(1, ub_emailaddress_length)
588physical_delivery_country_name = univ.Integer(8)
590id_at_givenName = _OID(id_at, 42)
593class TeletexCommonName(char.TeletexString):
594 pass
597TeletexCommonName.subtypeSpec = constraint.ValueSizeConstraint(1, ub_common_name_length)
599id_qt_cps = _OID(id_qt, 1)
602class LocalPostalAttributes(PDSParameter):
603 pass
606class StreetAddress(PDSParameter):
607 pass
610id_kp = _OID(id_pkix, 3)
613class DirectoryString(univ.Choice):
614 pass
617DirectoryString.componentType = namedtype.NamedTypes(
618 namedtype.NamedType('teletexString',
619 char.TeletexString().subtype(subtypeSpec=constraint.ValueSizeConstraint(1, MAX))),
620 namedtype.NamedType('printableString',
621 char.PrintableString().subtype(subtypeSpec=constraint.ValueSizeConstraint(1, MAX))),
622 namedtype.NamedType('universalString',
623 char.UniversalString().subtype(subtypeSpec=constraint.ValueSizeConstraint(1, MAX))),
624 namedtype.NamedType('utf8String', char.UTF8String().subtype(subtypeSpec=constraint.ValueSizeConstraint(1, MAX))),
625 namedtype.NamedType('bmpString', char.BMPString().subtype(subtypeSpec=constraint.ValueSizeConstraint(1, MAX)))
626)
629class DomainComponent(char.IA5String):
630 pass
633id_at_initials = _OID(id_at, 43)
635id_qt_unotice = _OID(id_qt, 2)
637ub_pds_name_length = univ.Integer(16)
640class PDSName(char.PrintableString):
641 pass
644PDSName.subtypeSpec = constraint.ValueSizeConstraint(1, ub_pds_name_length)
647class PosteRestanteAddress(PDSParameter):
648 pass
651class DistinguishedName(RDNSequence):
652 pass
655class CommonName(char.PrintableString):
656 pass
659CommonName.subtypeSpec = constraint.ValueSizeConstraint(1, ub_common_name_length)
661ub_serial_number = univ.Integer(64)
664class X520SerialNumber(char.PrintableString):
665 pass
668X520SerialNumber.subtypeSpec = constraint.ValueSizeConstraint(1, ub_serial_number)
670id_at_generationQualifier = _OID(id_at, 44)
672ub_organizational_unit_name = univ.Integer(64)
674id_ad_ocsp = _OID(id_ad, 1)
677class TeletexOrganizationalUnitName(char.TeletexString):
678 pass
681TeletexOrganizationalUnitName.subtypeSpec = constraint.ValueSizeConstraint(1, ub_organizational_unit_name_length)
684class TeletexPersonalName(univ.Set):
685 pass
688TeletexPersonalName.componentType = namedtype.NamedTypes(
689 namedtype.NamedType('surname', char.TeletexString().subtype(
690 subtypeSpec=constraint.ValueSizeConstraint(1, ub_surname_length)).subtype(
691 implicitTag=tag.Tag(tag.tagClassContext, tag.tagFormatSimple, 0))),
692 namedtype.OptionalNamedType('given-name', char.TeletexString().subtype(
693 subtypeSpec=constraint.ValueSizeConstraint(1, ub_given_name_length)).subtype(
694 implicitTag=tag.Tag(tag.tagClassContext, tag.tagFormatSimple, 1))),
695 namedtype.OptionalNamedType('initials', char.TeletexString().subtype(
696 subtypeSpec=constraint.ValueSizeConstraint(1, ub_initials_length)).subtype(
697 implicitTag=tag.Tag(tag.tagClassContext, tag.tagFormatSimple, 2))),
698 namedtype.OptionalNamedType('generation-qualifier', char.TeletexString().subtype(
699 subtypeSpec=constraint.ValueSizeConstraint(1, ub_generation_qualifier_length)).subtype(
700 implicitTag=tag.Tag(tag.tagClassContext, tag.tagFormatSimple, 3)))
701)
704class TeletexDomainDefinedAttributes(univ.SequenceOf):
705 pass
708TeletexDomainDefinedAttributes.componentType = TeletexDomainDefinedAttribute()
709TeletexDomainDefinedAttributes.sizeSpec = constraint.ValueSizeConstraint(1, ub_domain_defined_attributes)
712class TBSCertList(univ.Sequence):
713 pass
716TBSCertList.componentType = namedtype.NamedTypes(
717 namedtype.OptionalNamedType('version', Version()),
718 namedtype.NamedType('signature', AlgorithmIdentifier()),
719 namedtype.NamedType('issuer', Name()),
720 namedtype.NamedType('thisUpdate', Time()),
721 namedtype.OptionalNamedType('nextUpdate', Time()),
722 namedtype.OptionalNamedType('revokedCertificates',
723 univ.SequenceOf(componentType=univ.Sequence(componentType=namedtype.NamedTypes(
724 namedtype.NamedType('userCertificate', CertificateSerialNumber()),
725 namedtype.NamedType('revocationDate', Time()),
726 namedtype.OptionalNamedType('crlEntryExtensions', Extensions())
727 ))
728 )),
729 namedtype.OptionalNamedType('crlExtensions',
730 Extensions().subtype(explicitTag=tag.Tag(tag.tagClassContext, tag.tagFormatSimple, 0)))
731)
733local_postal_attributes = univ.Integer(21)
735pkcs_9 = _OID(1, 2, 840, 113549, 1, 9)
738class PhysicalDeliveryCountryName(univ.Choice):
739 pass
742PhysicalDeliveryCountryName.componentType = namedtype.NamedTypes(
743 namedtype.NamedType('x121-dcc-code', char.NumericString().subtype(
744 subtypeSpec=constraint.ValueSizeConstraint(ub_country_name_numeric_length, ub_country_name_numeric_length))),
745 namedtype.NamedType('iso-3166-alpha2-code', char.PrintableString().subtype(
746 subtypeSpec=constraint.ValueSizeConstraint(ub_country_name_alpha_length, ub_country_name_alpha_length)))
747)
749ub_name = univ.Integer(32768)
752class X520name(univ.Choice):
753 pass
756X520name.componentType = namedtype.NamedTypes(
757 namedtype.NamedType('teletexString',
758 char.TeletexString().subtype(subtypeSpec=constraint.ValueSizeConstraint(1, ub_name))),
759 namedtype.NamedType('printableString',
760 char.PrintableString().subtype(subtypeSpec=constraint.ValueSizeConstraint(1, ub_name))),
761 namedtype.NamedType('universalString',
762 char.UniversalString().subtype(subtypeSpec=constraint.ValueSizeConstraint(1, ub_name))),
763 namedtype.NamedType('utf8String',
764 char.UTF8String().subtype(subtypeSpec=constraint.ValueSizeConstraint(1, ub_name))),
765 namedtype.NamedType('bmpString', char.BMPString().subtype(subtypeSpec=constraint.ValueSizeConstraint(1, ub_name)))
766)
768id_emailAddress = _OID(pkcs_9, 1)
771class TerminalType(univ.Integer):
772 pass
775TerminalType.namedValues = namedval.NamedValues(
776 ('telex', 3),
777 ('teletex', 4),
778 ('g3-facsimile', 5),
779 ('g4-facsimile', 6),
780 ('ia5-terminal', 7),
781 ('videotex', 8)
782)
785class X520OrganizationalUnitName(univ.Choice):
786 pass
789X520OrganizationalUnitName.componentType = namedtype.NamedTypes(
790 namedtype.NamedType('teletexString', char.TeletexString().subtype(
791 subtypeSpec=constraint.ValueSizeConstraint(1, ub_organizational_unit_name))),
792 namedtype.NamedType('printableString', char.PrintableString().subtype(
793 subtypeSpec=constraint.ValueSizeConstraint(1, ub_organizational_unit_name))),
794 namedtype.NamedType('universalString', char.UniversalString().subtype(
795 subtypeSpec=constraint.ValueSizeConstraint(1, ub_organizational_unit_name))),
796 namedtype.NamedType('utf8String', char.UTF8String().subtype(
797 subtypeSpec=constraint.ValueSizeConstraint(1, ub_organizational_unit_name))),
798 namedtype.NamedType('bmpString', char.BMPString().subtype(
799 subtypeSpec=constraint.ValueSizeConstraint(1, ub_organizational_unit_name)))
800)
802id_at_commonName = _OID(id_at, 3)
804pds_name = univ.Integer(7)
806post_office_box_address = univ.Integer(18)
808ub_locality_name = univ.Integer(128)
811class X520LocalityName(univ.Choice):
812 pass
815X520LocalityName.componentType = namedtype.NamedTypes(
816 namedtype.NamedType('teletexString',
817 char.TeletexString().subtype(subtypeSpec=constraint.ValueSizeConstraint(1, ub_locality_name))),
818 namedtype.NamedType('printableString', char.PrintableString().subtype(
819 subtypeSpec=constraint.ValueSizeConstraint(1, ub_locality_name))),
820 namedtype.NamedType('universalString', char.UniversalString().subtype(
821 subtypeSpec=constraint.ValueSizeConstraint(1, ub_locality_name))),
822 namedtype.NamedType('utf8String',
823 char.UTF8String().subtype(subtypeSpec=constraint.ValueSizeConstraint(1, ub_locality_name))),
824 namedtype.NamedType('bmpString',
825 char.BMPString().subtype(subtypeSpec=constraint.ValueSizeConstraint(1, ub_locality_name)))
826)
828id_ad_timeStamping = _OID(id_ad, 3)
830id_at_countryName = _OID(id_at, 6)
832physical_delivery_personal_name = univ.Integer(13)
834teletex_personal_name = univ.Integer(4)
836teletex_organizational_unit_names = univ.Integer(5)
839class PhysicalDeliveryPersonalName(PDSParameter):
840 pass
843ub_postal_code_length = univ.Integer(16)
846class PostalCode(univ.Choice):
847 pass
850PostalCode.componentType = namedtype.NamedTypes(
851 namedtype.NamedType('numeric-code', char.NumericString().subtype(
852 subtypeSpec=constraint.ValueSizeConstraint(1, ub_postal_code_length))),
853 namedtype.NamedType('printable-code', char.PrintableString().subtype(
854 subtypeSpec=constraint.ValueSizeConstraint(1, ub_postal_code_length)))
855)
858class X520countryName(char.PrintableString):
859 pass
862X520countryName.subtypeSpec = constraint.ValueSizeConstraint(2, 2)
864postal_code = univ.Integer(9)
866id_ad_caRepository = _OID(id_ad, 5)
868extension_physical_delivery_address_components = univ.Integer(15)
871class PostOfficeBoxAddress(PDSParameter):
872 pass
875class PhysicalDeliveryOfficeName(PDSParameter):
876 pass
879id_at_title = _OID(id_at, 12)
881id_at_serialNumber = _OID(id_at, 5)
883id_ad_caIssuers = _OID(id_ad, 2)
885ub_integer_options = univ.Integer(256)
888class CertificateList(univ.Sequence):
889 pass
892CertificateList.componentType = namedtype.NamedTypes(
893 namedtype.NamedType('tbsCertList', TBSCertList()),
894 namedtype.NamedType('signatureAlgorithm', AlgorithmIdentifier()),
895 namedtype.NamedType('signature', univ.BitString())
896)
899class PhysicalDeliveryOfficeNumber(PDSParameter):
900 pass
903class TeletexOrganizationalUnitNames(univ.SequenceOf):
904 pass
907TeletexOrganizationalUnitNames.componentType = TeletexOrganizationalUnitName()
908TeletexOrganizationalUnitNames.sizeSpec = constraint.ValueSizeConstraint(1, ub_organizational_units)
910physical_delivery_office_name = univ.Integer(10)
912ub_common_name = univ.Integer(64)
915class ExtensionORAddressComponents(PDSParameter):
916 pass
919ub_pseudonym = univ.Integer(128)
921poste_restante_address = univ.Integer(19)
923id_at_organizationName = _OID(id_at, 10)
925physical_delivery_office_number = univ.Integer(11)
927id_at_pseudonym = _OID(id_at, 65)
930class X520CommonName(univ.Choice):
931 pass
934X520CommonName.componentType = namedtype.NamedTypes(
935 namedtype.NamedType('teletexString',
936 char.TeletexString().subtype(subtypeSpec=constraint.ValueSizeConstraint(1, ub_common_name))),
937 namedtype.NamedType('printableString',
938 char.PrintableString().subtype(subtypeSpec=constraint.ValueSizeConstraint(1, ub_common_name))),
939 namedtype.NamedType('universalString',
940 char.UniversalString().subtype(subtypeSpec=constraint.ValueSizeConstraint(1, ub_common_name))),
941 namedtype.NamedType('utf8String',
942 char.UTF8String().subtype(subtypeSpec=constraint.ValueSizeConstraint(1, ub_common_name))),
943 namedtype.NamedType('bmpString',
944 char.BMPString().subtype(subtypeSpec=constraint.ValueSizeConstraint(1, ub_common_name)))
945)
947physical_delivery_organization_name = univ.Integer(14)
950class X520dnQualifier(char.PrintableString):
951 pass
954id_at_stateOrProvinceName = _OID(id_at, 8)
956common_name = univ.Integer(1)
958id_at_localityName = _OID(id_at, 7)
960ub_match = univ.Integer(128)
962ub_unformatted_address_length = univ.Integer(180)
965class Attribute(univ.Sequence):
966 pass
969Attribute.componentType = namedtype.NamedTypes(
970 namedtype.NamedType('type', AttributeType()),
971 namedtype.NamedType('values', univ.SetOf(componentType=AttributeValue()))
972)
974extended_network_address = univ.Integer(22)
976unique_postal_name = univ.Integer(20)
978ub_pds_physical_address_lines = univ.Integer(6)
981class UnformattedPostalAddress(univ.Set):
982 pass
985UnformattedPostalAddress.componentType = namedtype.NamedTypes(
986 namedtype.OptionalNamedType('printable-address', univ.SequenceOf(componentType=char.PrintableString().subtype(
987 subtypeSpec=constraint.ValueSizeConstraint(1, ub_pds_parameter_length)))),
988 namedtype.OptionalNamedType('teletex-string', char.TeletexString().subtype(
989 subtypeSpec=constraint.ValueSizeConstraint(1, ub_unformatted_address_length)))
990)
993class UniquePostalName(PDSParameter):
994 pass
997class X520Pseudonym(univ.Choice):
998 pass
1001X520Pseudonym.componentType = namedtype.NamedTypes(
1002 namedtype.NamedType('teletexString',
1003 char.TeletexString().subtype(subtypeSpec=constraint.ValueSizeConstraint(1, ub_pseudonym))),
1004 namedtype.NamedType('printableString',
1005 char.PrintableString().subtype(subtypeSpec=constraint.ValueSizeConstraint(1, ub_pseudonym))),
1006 namedtype.NamedType('universalString',
1007 char.UniversalString().subtype(subtypeSpec=constraint.ValueSizeConstraint(1, ub_pseudonym))),
1008 namedtype.NamedType('utf8String',
1009 char.UTF8String().subtype(subtypeSpec=constraint.ValueSizeConstraint(1, ub_pseudonym))),
1010 namedtype.NamedType('bmpString',
1011 char.BMPString().subtype(subtypeSpec=constraint.ValueSizeConstraint(1, ub_pseudonym)))
1012)
1014teletex_organization_name = univ.Integer(3)
1016teletex_domain_defined_attributes = univ.Integer(6)
1018street_address = univ.Integer(17)
1020id_kp_OCSPSigning = _OID(id_kp, 9)
1022id_ce = _OID(2, 5, 29)
1024id_ce_certificatePolicies = _OID(id_ce, 32)
1027class EDIPartyName(univ.Sequence):
1028 pass
1031EDIPartyName.componentType = namedtype.NamedTypes(
1032 namedtype.OptionalNamedType('nameAssigner', DirectoryString().subtype(
1033 implicitTag=tag.Tag(tag.tagClassContext, tag.tagFormatSimple, 0))),
1034 namedtype.NamedType('partyName',
1035 DirectoryString().subtype(implicitTag=tag.Tag(tag.tagClassContext, tag.tagFormatSimple, 1)))
1036)
1039class AnotherName(univ.Sequence):
1040 pass
1043AnotherName.componentType = namedtype.NamedTypes(
1044 namedtype.NamedType('type-id', univ.ObjectIdentifier()),
1045 namedtype.NamedType('value', univ.Any().subtype(explicitTag=tag.Tag(tag.tagClassContext, tag.tagFormatSimple, 0)))
1046)
1049class GeneralName(univ.Choice):
1050 pass
1053GeneralName.componentType = namedtype.NamedTypes(
1054 namedtype.NamedType('otherName',
1055 AnotherName().subtype(implicitTag=tag.Tag(tag.tagClassContext, tag.tagFormatConstructed, 0))),
1056 namedtype.NamedType('rfc822Name',
1057 char.IA5String().subtype(implicitTag=tag.Tag(tag.tagClassContext, tag.tagFormatSimple, 1))),
1058 namedtype.NamedType('dNSName',
1059 char.IA5String().subtype(implicitTag=tag.Tag(tag.tagClassContext, tag.tagFormatSimple, 2))),
1060 namedtype.NamedType('x400Address',
1061 ORAddress().subtype(implicitTag=tag.Tag(tag.tagClassContext, tag.tagFormatSimple, 3))),
1062 namedtype.NamedType('directoryName',
1063 Name().subtype(implicitTag=tag.Tag(tag.tagClassContext, tag.tagFormatConstructed, 4))),
1064 namedtype.NamedType('ediPartyName',
1065 EDIPartyName().subtype(implicitTag=tag.Tag(tag.tagClassContext, tag.tagFormatConstructed, 5))),
1066 namedtype.NamedType('uniformResourceIdentifier',
1067 char.IA5String().subtype(implicitTag=tag.Tag(tag.tagClassContext, tag.tagFormatSimple, 6))),
1068 namedtype.NamedType('iPAddress',
1069 univ.OctetString().subtype(implicitTag=tag.Tag(tag.tagClassContext, tag.tagFormatSimple, 7))),
1070 namedtype.NamedType('registeredID', univ.ObjectIdentifier().subtype(
1071 implicitTag=tag.Tag(tag.tagClassContext, tag.tagFormatSimple, 8)))
1072)
1075class GeneralNames(univ.SequenceOf):
1076 pass
1079GeneralNames.componentType = GeneralName()
1080GeneralNames.sizeSpec = constraint.ValueSizeConstraint(1, MAX)
1083class IssuerAltName(GeneralNames):
1084 pass
1087id_ce_cRLDistributionPoints = _OID(id_ce, 31)
1090class CertPolicyId(univ.ObjectIdentifier):
1091 pass
1094class PolicyMappings(univ.SequenceOf):
1095 pass
1098PolicyMappings.componentType = univ.Sequence(componentType=namedtype.NamedTypes(
1099 namedtype.NamedType('issuerDomainPolicy', CertPolicyId()),
1100 namedtype.NamedType('subjectDomainPolicy', CertPolicyId())
1101))
1103PolicyMappings.sizeSpec = constraint.ValueSizeConstraint(1, MAX)
1106class PolicyQualifierId(univ.ObjectIdentifier):
1107 pass
1110holdInstruction = _OID(2, 2, 840, 10040, 2)
1112id_ce_subjectDirectoryAttributes = _OID(id_ce, 9)
1114id_holdinstruction_callissuer = _OID(holdInstruction, 2)
1117class SubjectDirectoryAttributes(univ.SequenceOf):
1118 pass
1121SubjectDirectoryAttributes.componentType = Attribute()
1122SubjectDirectoryAttributes.sizeSpec = constraint.ValueSizeConstraint(1, MAX)
1124anyPolicy = _OID(id_ce_certificatePolicies, 0)
1126id_ce_subjectAltName = _OID(id_ce, 17)
1128id_kp_emailProtection = _OID(id_kp, 4)
1131class ReasonFlags(univ.BitString):
1132 pass
1135ReasonFlags.namedValues = namedval.NamedValues(
1136 ('unused', 0),
1137 ('keyCompromise', 1),
1138 ('cACompromise', 2),
1139 ('affiliationChanged', 3),
1140 ('superseded', 4),
1141 ('cessationOfOperation', 5),
1142 ('certificateHold', 6),
1143 ('privilegeWithdrawn', 7),
1144 ('aACompromise', 8)
1145)
1148class DistributionPointName(univ.Choice):
1149 pass
1152DistributionPointName.componentType = namedtype.NamedTypes(
1153 namedtype.NamedType('fullName',
1154 GeneralNames().subtype(implicitTag=tag.Tag(tag.tagClassContext, tag.tagFormatSimple, 0))),
1155 namedtype.NamedType('nameRelativeToCRLIssuer', RelativeDistinguishedName().subtype(
1156 implicitTag=tag.Tag(tag.tagClassContext, tag.tagFormatSimple, 1)))
1157)
1160class DistributionPoint(univ.Sequence):
1161 pass
1164DistributionPoint.componentType = namedtype.NamedTypes(
1165 namedtype.OptionalNamedType('distributionPoint', DistributionPointName().subtype(
1166 implicitTag=tag.Tag(tag.tagClassContext, tag.tagFormatConstructed, 0))),
1167 namedtype.OptionalNamedType('reasons', ReasonFlags().subtype(
1168 implicitTag=tag.Tag(tag.tagClassContext, tag.tagFormatSimple, 1))),
1169 namedtype.OptionalNamedType('cRLIssuer', GeneralNames().subtype(
1170 implicitTag=tag.Tag(tag.tagClassContext, tag.tagFormatSimple, 2)))
1171)
1173id_ce_keyUsage = _OID(id_ce, 15)
1176class PolicyQualifierInfo(univ.Sequence):
1177 pass
1180PolicyQualifierInfo.componentType = namedtype.NamedTypes(
1181 namedtype.NamedType('policyQualifierId', PolicyQualifierId()),
1182 namedtype.NamedType('qualifier', univ.Any())
1183)
1186class PolicyInformation(univ.Sequence):
1187 pass
1190PolicyInformation.componentType = namedtype.NamedTypes(
1191 namedtype.NamedType('policyIdentifier', CertPolicyId()),
1192 namedtype.OptionalNamedType('policyQualifiers', univ.SequenceOf(componentType=PolicyQualifierInfo()))
1193)
1196class CertificatePolicies(univ.SequenceOf):
1197 pass
1200CertificatePolicies.componentType = PolicyInformation()
1201CertificatePolicies.sizeSpec = constraint.ValueSizeConstraint(1, MAX)
1203id_ce_basicConstraints = _OID(id_ce, 19)
1206class HoldInstructionCode(univ.ObjectIdentifier):
1207 pass
1210class KeyPurposeId(univ.ObjectIdentifier):
1211 pass
1214class ExtKeyUsageSyntax(univ.SequenceOf):
1215 pass
1218ExtKeyUsageSyntax.componentType = KeyPurposeId()
1219ExtKeyUsageSyntax.sizeSpec = constraint.ValueSizeConstraint(1, MAX)
1222class SubjectAltName(GeneralNames):
1223 pass
1226class BasicConstraints(univ.Sequence):
1227 pass
1230BasicConstraints.componentType = namedtype.NamedTypes(
1231 namedtype.DefaultedNamedType('cA', univ.Boolean().subtype(value=0)),
1232 namedtype.OptionalNamedType('pathLenConstraint',
1233 univ.Integer().subtype(subtypeSpec=constraint.ValueRangeConstraint(0, MAX)))
1234)
1237class SkipCerts(univ.Integer):
1238 pass
1241SkipCerts.subtypeSpec = constraint.ValueRangeConstraint(0, MAX)
1244class InhibitAnyPolicy(SkipCerts):
1245 pass
1248class CRLNumber(univ.Integer):
1249 pass
1252CRLNumber.subtypeSpec = constraint.ValueRangeConstraint(0, MAX)
1255class BaseCRLNumber(CRLNumber):
1256 pass
1259class KeyIdentifier(univ.OctetString):
1260 pass
1263class AuthorityKeyIdentifier(univ.Sequence):
1264 pass
1267AuthorityKeyIdentifier.componentType = namedtype.NamedTypes(
1268 namedtype.OptionalNamedType('keyIdentifier', KeyIdentifier().subtype(
1269 implicitTag=tag.Tag(tag.tagClassContext, tag.tagFormatSimple, 0))),
1270 namedtype.OptionalNamedType('authorityCertIssuer', GeneralNames().subtype(
1271 implicitTag=tag.Tag(tag.tagClassContext, tag.tagFormatSimple, 1))),
1272 namedtype.OptionalNamedType('authorityCertSerialNumber', CertificateSerialNumber().subtype(
1273 implicitTag=tag.Tag(tag.tagClassContext, tag.tagFormatSimple, 2)))
1274)
1276id_ce_nameConstraints = _OID(id_ce, 30)
1278id_kp_serverAuth = _OID(id_kp, 1)
1280id_ce_freshestCRL = _OID(id_ce, 46)
1282id_ce_cRLReasons = _OID(id_ce, 21)
1285class CRLDistributionPoints(univ.SequenceOf):
1286 pass
1289CRLDistributionPoints.componentType = DistributionPoint()
1290CRLDistributionPoints.sizeSpec = constraint.ValueSizeConstraint(1, MAX)
1293class FreshestCRL(CRLDistributionPoints):
1294 pass
1297id_ce_inhibitAnyPolicy = _OID(id_ce, 54)
1300class CRLReason(univ.Enumerated):
1301 pass
1304CRLReason.namedValues = namedval.NamedValues(
1305 ('unspecified', 0),
1306 ('keyCompromise', 1),
1307 ('cACompromise', 2),
1308 ('affiliationChanged', 3),
1309 ('superseded', 4),
1310 ('cessationOfOperation', 5),
1311 ('certificateHold', 6),
1312 ('removeFromCRL', 8),
1313 ('privilegeWithdrawn', 9),
1314 ('aACompromise', 10)
1315)
1318class BaseDistance(univ.Integer):
1319 pass
1322BaseDistance.subtypeSpec = constraint.ValueRangeConstraint(0, MAX)
1325class GeneralSubtree(univ.Sequence):
1326 pass
1329GeneralSubtree.componentType = namedtype.NamedTypes(
1330 namedtype.NamedType('base', GeneralName()),
1331 namedtype.DefaultedNamedType('minimum', BaseDistance().subtype(
1332 implicitTag=tag.Tag(tag.tagClassContext, tag.tagFormatSimple, 0)).subtype(value=0)),
1333 namedtype.OptionalNamedType('maximum', BaseDistance().subtype(
1334 implicitTag=tag.Tag(tag.tagClassContext, tag.tagFormatSimple, 1)))
1335)
1338class GeneralSubtrees(univ.SequenceOf):
1339 pass
1342GeneralSubtrees.componentType = GeneralSubtree()
1343GeneralSubtrees.sizeSpec = constraint.ValueSizeConstraint(1, MAX)
1346class NameConstraints(univ.Sequence):
1347 pass
1350NameConstraints.componentType = namedtype.NamedTypes(
1351 namedtype.OptionalNamedType('permittedSubtrees', GeneralSubtrees().subtype(
1352 implicitTag=tag.Tag(tag.tagClassContext, tag.tagFormatSimple, 0))),
1353 namedtype.OptionalNamedType('excludedSubtrees', GeneralSubtrees().subtype(
1354 implicitTag=tag.Tag(tag.tagClassContext, tag.tagFormatSimple, 1)))
1355)
1357id_pe_authorityInfoAccess = _OID(id_pe, 1)
1359id_pe_subjectInfoAccess = _OID(id_pe, 11)
1361id_ce_certificateIssuer = _OID(id_ce, 29)
1363id_ce_invalidityDate = _OID(id_ce, 24)
1366class DirectoryString(univ.Choice):
1367 pass
1370DirectoryString.componentType = namedtype.NamedTypes(
1371 namedtype.NamedType('any', univ.Any())
1372)
1374id_ce_authorityKeyIdentifier = _OID(id_ce, 35)
1377class AccessDescription(univ.Sequence):
1378 pass
1381AccessDescription.componentType = namedtype.NamedTypes(
1382 namedtype.NamedType('accessMethod', univ.ObjectIdentifier()),
1383 namedtype.NamedType('accessLocation', GeneralName())
1384)
1387class AuthorityInfoAccessSyntax(univ.SequenceOf):
1388 pass
1391AuthorityInfoAccessSyntax.componentType = AccessDescription()
1392AuthorityInfoAccessSyntax.sizeSpec = constraint.ValueSizeConstraint(1, MAX)
1394id_ce_issuingDistributionPoint = _OID(id_ce, 28)
1397class CPSuri(char.IA5String):
1398 pass
1401class DisplayText(univ.Choice):
1402 pass
1405DisplayText.componentType = namedtype.NamedTypes(
1406 namedtype.NamedType('ia5String', char.IA5String().subtype(subtypeSpec=constraint.ValueSizeConstraint(1, 200))),
1407 namedtype.NamedType('visibleString',
1408 char.VisibleString().subtype(subtypeSpec=constraint.ValueSizeConstraint(1, 200))),
1409 namedtype.NamedType('bmpString', char.BMPString().subtype(subtypeSpec=constraint.ValueSizeConstraint(1, 200))),
1410 namedtype.NamedType('utf8String', char.UTF8String().subtype(subtypeSpec=constraint.ValueSizeConstraint(1, 200)))
1411)
1414class NoticeReference(univ.Sequence):
1415 pass
1418NoticeReference.componentType = namedtype.NamedTypes(
1419 namedtype.NamedType('organization', DisplayText()),
1420 namedtype.NamedType('noticeNumbers', univ.SequenceOf(componentType=univ.Integer()))
1421)
1424class UserNotice(univ.Sequence):
1425 pass
1428UserNotice.componentType = namedtype.NamedTypes(
1429 namedtype.OptionalNamedType('noticeRef', NoticeReference()),
1430 namedtype.OptionalNamedType('explicitText', DisplayText())
1431)
1434class PrivateKeyUsagePeriod(univ.Sequence):
1435 pass
1438PrivateKeyUsagePeriod.componentType = namedtype.NamedTypes(
1439 namedtype.OptionalNamedType('notBefore', useful.GeneralizedTime().subtype(
1440 implicitTag=tag.Tag(tag.tagClassContext, tag.tagFormatSimple, 0))),
1441 namedtype.OptionalNamedType('notAfter', useful.GeneralizedTime().subtype(
1442 implicitTag=tag.Tag(tag.tagClassContext, tag.tagFormatSimple, 1)))
1443)
1445id_ce_subjectKeyIdentifier = _OID(id_ce, 14)
1448class CertificateIssuer(GeneralNames):
1449 pass
1452class InvalidityDate(useful.GeneralizedTime):
1453 pass
1456class SubjectInfoAccessSyntax(univ.SequenceOf):
1457 pass
1460SubjectInfoAccessSyntax.componentType = AccessDescription()
1461SubjectInfoAccessSyntax.sizeSpec = constraint.ValueSizeConstraint(1, MAX)
1464class KeyUsage(univ.BitString):
1465 pass
1468KeyUsage.namedValues = namedval.NamedValues(
1469 ('digitalSignature', 0),
1470 ('nonRepudiation', 1),
1471 ('keyEncipherment', 2),
1472 ('dataEncipherment', 3),
1473 ('keyAgreement', 4),
1474 ('keyCertSign', 5),
1475 ('cRLSign', 6),
1476 ('encipherOnly', 7),
1477 ('decipherOnly', 8)
1478)
1480id_ce_extKeyUsage = _OID(id_ce, 37)
1482anyExtendedKeyUsage = _OID(id_ce_extKeyUsage, 0)
1484id_ce_privateKeyUsagePeriod = _OID(id_ce, 16)
1486id_ce_policyMappings = _OID(id_ce, 33)
1488id_ce_cRLNumber = _OID(id_ce, 20)
1490id_ce_policyConstraints = _OID(id_ce, 36)
1492id_holdinstruction_none = _OID(holdInstruction, 1)
1494id_holdinstruction_reject = _OID(holdInstruction, 3)
1496id_kp_timeStamping = _OID(id_kp, 8)
1499class PolicyConstraints(univ.Sequence):
1500 pass
1503PolicyConstraints.componentType = namedtype.NamedTypes(
1504 namedtype.OptionalNamedType('requireExplicitPolicy',
1505 SkipCerts().subtype(implicitTag=tag.Tag(tag.tagClassContext, tag.tagFormatSimple, 0))),
1506 namedtype.OptionalNamedType('inhibitPolicyMapping',
1507 SkipCerts().subtype(implicitTag=tag.Tag(tag.tagClassContext, tag.tagFormatSimple, 1)))
1508)
1511class SubjectKeyIdentifier(KeyIdentifier):
1512 pass
1515id_kp_clientAuth = _OID(id_kp, 2)
1517id_ce_deltaCRLIndicator = _OID(id_ce, 27)
1519id_ce_issuerAltName = _OID(id_ce, 18)
1521id_kp_codeSigning = _OID(id_kp, 3)
1523id_ce_holdInstructionCode = _OID(id_ce, 23)
1526class IssuingDistributionPoint(univ.Sequence):
1527 pass
1530IssuingDistributionPoint.componentType = namedtype.NamedTypes(
1531 namedtype.OptionalNamedType('distributionPoint', DistributionPointName().subtype(
1532 implicitTag=tag.Tag(tag.tagClassContext, tag.tagFormatConstructed, 0))),
1533 namedtype.DefaultedNamedType('onlyContainsUserCerts', univ.Boolean().subtype(
1534 implicitTag=tag.Tag(tag.tagClassContext, tag.tagFormatSimple, 1)).subtype(value=0)),
1535 namedtype.DefaultedNamedType('onlyContainsCACerts', univ.Boolean().subtype(
1536 implicitTag=tag.Tag(tag.tagClassContext, tag.tagFormatSimple, 2)).subtype(value=0)),
1537 namedtype.OptionalNamedType('onlySomeReasons', ReasonFlags().subtype(
1538 implicitTag=tag.Tag(tag.tagClassContext, tag.tagFormatSimple, 3))),
1539 namedtype.DefaultedNamedType('indirectCRL', univ.Boolean().subtype(
1540 implicitTag=tag.Tag(tag.tagClassContext, tag.tagFormatSimple, 4)).subtype(value=0)),
1541 namedtype.DefaultedNamedType('onlyContainsAttributeCerts', univ.Boolean().subtype(
1542 implicitTag=tag.Tag(tag.tagClassContext, tag.tagFormatSimple, 5)).subtype(value=0))
1543)