aboutsummaryrefslogtreecommitdiff
path: root/pyasn1_modules
diff options
context:
space:
mode:
authorIlya Etingof <ietingof@redhat.com>2017-06-01 22:28:00 +0200
committerIlya Etingof <ietingof@redhat.com>2017-06-01 22:28:00 +0200
commit5f919aa833afe37c393457713b247ff3f430bcf0 (patch)
tree93824818925c9cd094cb22dc331d57f71752ddc9 /pyasn1_modules
parente4470310211efd9915ce9b7c91a7e04e1c168582 (diff)
downloadpyasn1-modules-5f919aa833afe37c393457713b247ff3f430bcf0.tar.gz
pep8 everything
Diffstat (limited to 'pyasn1_modules')
-rw-r--r--pyasn1_modules/rfc2251.py99
-rw-r--r--pyasn1_modules/rfc2511.py14
-rw-r--r--pyasn1_modules/rfc3279.py3
-rw-r--r--pyasn1_modules/rfc3281.py22
-rw-r--r--pyasn1_modules/rfc3447.py1
-rw-r--r--pyasn1_modules/rfc3852.py15
-rw-r--r--pyasn1_modules/rfc4210.py357
-rw-r--r--pyasn1_modules/rfc4211.py31
-rw-r--r--pyasn1_modules/rfc5280.py49
-rw-r--r--pyasn1_modules/rfc5652.py15
-rw-r--r--pyasn1_modules/rfc6402.py71
11 files changed, 374 insertions, 303 deletions
diff --git a/pyasn1_modules/rfc2251.py b/pyasn1_modules/rfc2251.py
index d4a245a..94ba589 100644
--- a/pyasn1_modules/rfc2251.py
+++ b/pyasn1_modules/rfc2251.py
@@ -124,8 +124,11 @@ class BindRequest(univ.Sequence):
class PartialAttributeList(univ.SequenceOf):
componentType = univ.Sequence(
- componentType=namedtype.NamedTypes(namedtype.NamedType('type', AttributeDescription()),
- namedtype.NamedType('vals', univ.SetOf(componentType=AttributeValue()))))
+ componentType=namedtype.NamedTypes(
+ namedtype.NamedType('type', AttributeDescription()),
+ namedtype.NamedType('vals', univ.SetOf(componentType=AttributeValue()))
+ )
+ )
class SearchResultEntry(univ.Sequence):
@@ -154,13 +157,23 @@ class MatchingRuleAssertion(univ.Sequence):
class SubstringFilter(univ.Sequence):
componentType = namedtype.NamedTypes(
namedtype.NamedType('type', AttributeDescription()),
- namedtype.NamedType('substrings', univ.SequenceOf(componentType=univ.Choice(componentType=namedtype.NamedTypes(
- namedtype.NamedType('initial',
- LDAPString().subtype(implicitTag=tag.Tag(tag.tagClassContext, tag.tagFormatSimple, 0))),
- namedtype.NamedType('any',
- LDAPString().subtype(implicitTag=tag.Tag(tag.tagClassContext, tag.tagFormatSimple, 1))),
- namedtype.NamedType('final', LDAPString().subtype(
- implicitTag=tag.Tag(tag.tagClassContext, tag.tagFormatSimple, 2)))))))
+ namedtype.NamedType('substrings',
+ univ.SequenceOf(
+ componentType=univ.Choice(
+ componentType=namedtype.NamedTypes(
+ namedtype.NamedType(
+ 'initial', LDAPString().subtype(implicitTag=tag.Tag(tag.tagClassContext, tag.tagFormatSimple, 0))
+ ),
+ namedtype.NamedType(
+ 'any', LDAPString().subtype(implicitTag=tag.Tag(tag.tagClassContext, tag.tagFormatSimple, 1))
+ ),
+ namedtype.NamedType(
+ 'final', LDAPString().subtype(implicitTag=tag.Tag(tag.tagClassContext, tag.tagFormatSimple, 2))
+ )
+ )
+ )
+ )
+ )
)
@@ -357,10 +370,16 @@ class ModifyRequest(univ.Sequence):
)
componentType = namedtype.NamedTypes(
namedtype.NamedType('object', LDAPDN()),
- namedtype.NamedType('modification', univ.SequenceOf(componentType=univ.Sequence(
- componentType=namedtype.NamedTypes(namedtype.NamedType('operation', univ.Enumerated(
- namedValues=namedval.NamedValues(('add', 0), ('delete', 1), ('replace', 2)))),
- namedtype.NamedType('modification', AttributeTypeAndValues())))))
+ namedtype.NamedType('modification',
+ univ.SequenceOf(
+ componentType=univ.Sequence(
+ componentType=namedtype.NamedTypes(
+ namedtype.NamedType(
+ 'operation', univ.Enumerated(namedValues=namedval.NamedValues(('add', 0), ('delete', 1), ('replace', 2)))
+ ),
+ namedtype.NamedType('modification', AttributeTypeAndValues())))
+ )
+ )
)
@@ -372,8 +391,11 @@ class ModifyResponse(LDAPResult):
class AttributeList(univ.SequenceOf):
componentType = univ.Sequence(
- componentType=namedtype.NamedTypes(namedtype.NamedType('type', AttributeDescription()),
- namedtype.NamedType('vals', univ.SetOf(componentType=AttributeValue()))))
+ componentType=namedtype.NamedTypes(
+ namedtype.NamedType('type', AttributeDescription()),
+ namedtype.NamedType('vals', univ.SetOf(componentType=AttributeValue()))
+ )
+ )
class AddRequest(univ.Sequence):
@@ -506,27 +528,32 @@ class MessageID(univ.Integer):
class LDAPMessage(univ.Sequence):
componentType = namedtype.NamedTypes(
namedtype.NamedType('messageID', MessageID()),
- namedtype.NamedType('protocolOp', univ.Choice(
- componentType=namedtype.NamedTypes(namedtype.NamedType('bindRequest', BindRequest()),
- namedtype.NamedType('bindResponse', BindResponse()),
- namedtype.NamedType('unbindRequest', UnbindRequest()),
- namedtype.NamedType('searchRequest', SearchRequest()),
- namedtype.NamedType('searchResEntry', SearchResultEntry()),
- namedtype.NamedType('searchResDone', SearchResultDone()),
- namedtype.NamedType('searchResRef', SearchResultReference()),
- namedtype.NamedType('modifyRequest', ModifyRequest()),
- namedtype.NamedType('modifyResponse', ModifyResponse()),
- namedtype.NamedType('addRequest', AddRequest()),
- namedtype.NamedType('addResponse', AddResponse()),
- namedtype.NamedType('delRequest', DelRequest()),
- namedtype.NamedType('delResponse', DelResponse()),
- namedtype.NamedType('modDNRequest', ModifyDNRequest()),
- namedtype.NamedType('modDNResponse', ModifyDNResponse()),
- namedtype.NamedType('compareRequest', CompareRequest()),
- namedtype.NamedType('compareResponse', CompareResponse()),
- namedtype.NamedType('abandonRequest', AbandonRequest()),
- namedtype.NamedType('extendedReq', ExtendedRequest()),
- namedtype.NamedType('extendedResp', ExtendedResponse())))),
+ namedtype.NamedType(
+ 'protocolOp', univ.Choice(
+ componentType=namedtype.NamedTypes(
+ namedtype.NamedType('bindRequest', BindRequest()),
+ namedtype.NamedType('bindResponse', BindResponse()),
+ namedtype.NamedType('unbindRequest', UnbindRequest()),
+ namedtype.NamedType('searchRequest', SearchRequest()),
+ namedtype.NamedType('searchResEntry', SearchResultEntry()),
+ namedtype.NamedType('searchResDone', SearchResultDone()),
+ namedtype.NamedType('searchResRef', SearchResultReference()),
+ namedtype.NamedType('modifyRequest', ModifyRequest()),
+ namedtype.NamedType('modifyResponse', ModifyResponse()),
+ namedtype.NamedType('addRequest', AddRequest()),
+ namedtype.NamedType('addResponse', AddResponse()),
+ namedtype.NamedType('delRequest', DelRequest()),
+ namedtype.NamedType('delResponse', DelResponse()),
+ namedtype.NamedType('modDNRequest', ModifyDNRequest()),
+ namedtype.NamedType('modDNResponse', ModifyDNResponse()),
+ namedtype.NamedType('compareRequest', CompareRequest()),
+ namedtype.NamedType('compareResponse', CompareResponse()),
+ namedtype.NamedType('abandonRequest', AbandonRequest()),
+ namedtype.NamedType('extendedReq', ExtendedRequest()),
+ namedtype.NamedType('extendedResp', ExtendedResponse())
+ )
+ )
+ ),
namedtype.OptionalNamedType('controls', Controls().subtype(
implicitTag=tag.Tag(tag.tagClassContext, tag.tagFormatConstructed, 0)))
)
diff --git a/pyasn1_modules/rfc2511.py b/pyasn1_modules/rfc2511.py
index 1cc2fe8..d1ac97a 100644
--- a/pyasn1_modules/rfc2511.py
+++ b/pyasn1_modules/rfc2511.py
@@ -157,12 +157,16 @@ class PKMACValue(univ.Sequence):
class POPOSigningKeyInput(univ.Sequence):
componentType = namedtype.NamedTypes(
- namedtype.NamedType('authInfo', univ.Choice(
- componentType=namedtype.NamedTypes(
- namedtype.NamedType('sender', GeneralName().subtype(implicitTag=tag.Tag(tag.tagClassContext, tag.tagFormatSimple, 0))),
- namedtype.NamedType('publicKeyMAC', PKMACValue())
+ namedtype.NamedType(
+ 'authInfo', univ.Choice(
+ componentType=namedtype.NamedTypes(
+ namedtype.NamedType(
+ 'sender', GeneralName().subtype(implicitTag=tag.Tag(tag.tagClassContext, tag.tagFormatSimple, 0))
+ ),
+ namedtype.NamedType('publicKeyMAC', PKMACValue())
+ )
)
- )),
+ ),
namedtype.NamedType('publicKey', SubjectPublicKeyInfo())
)
diff --git a/pyasn1_modules/rfc3279.py b/pyasn1_modules/rfc3279.py
index fee49de..f69ff08 100644
--- a/pyasn1_modules/rfc3279.py
+++ b/pyasn1_modules/rfc3279.py
@@ -1,7 +1,7 @@
#
# This file is part of pyasn1-modules.
#
-# Copyright (c) 2017, Danielle Madeley <danielle@madeley.id.au>A
+# Copyright (c) 2017, Danielle Madeley <danielle@madeley.id.au>
# License: http://pyasn1.sf.net/license.html
#
# Derived from RFC 3279
@@ -221,7 +221,6 @@ c2tnb359v1 = _OID(c_TwoCurve, 18)
c2pnb368w1 = _OID(c_TwoCurve, 19)
c2tnb431r1 = _OID(c_TwoCurve, 20)
-
primeCurve = _OID(ellipticCurve, 1)
prime192v1 = _OID(primeCurve, 1)
prime192v2 = _OID(primeCurve, 2)
diff --git a/pyasn1_modules/rfc3281.py b/pyasn1_modules/rfc3281.py
index f31ac25..2fcb330 100644
--- a/pyasn1_modules/rfc3281.py
+++ b/pyasn1_modules/rfc3281.py
@@ -312,14 +312,20 @@ class IetfAttrSyntax(univ.Sequence):
IetfAttrSyntax.componentType = namedtype.NamedTypes(
- namedtype.OptionalNamedType('policyAuthority', rfc3280.GeneralNames().subtype(
- implicitTag=tag.Tag(tag.tagClassContext, tag.tagFormatSimple, 0))),
- namedtype.NamedType('values', univ.SequenceOf(componentType=univ.Choice(componentType=namedtype.NamedTypes(
- namedtype.NamedType('octets', univ.OctetString()),
- namedtype.NamedType('oid', univ.ObjectIdentifier()),
- namedtype.NamedType('string', char.UTF8String())
- ))
- ))
+ namedtype.OptionalNamedType(
+ 'policyAuthority', rfc3280.GeneralNames().subtype(implicitTag=tag.Tag(tag.tagClassContext, tag.tagFormatSimple, 0))
+ ),
+ namedtype.NamedType(
+ 'values', univ.SequenceOf(
+ componentType=univ.Choice(
+ componentType=namedtype.NamedTypes(
+ namedtype.NamedType('octets', univ.OctetString()),
+ namedtype.NamedType('oid', univ.ObjectIdentifier()),
+ namedtype.NamedType('string', char.UTF8String())
+ )
+ )
+ )
+ )
)
id_aca_encAttrs = _buildOid(id_aca, 6)
diff --git a/pyasn1_modules/rfc3447.py b/pyasn1_modules/rfc3447.py
index 5337598..57c99fa 100644
--- a/pyasn1_modules/rfc3447.py
+++ b/pyasn1_modules/rfc3447.py
@@ -11,6 +11,7 @@
#
# Sample captures could be obtained with "openssl genrsa" command
#
+from pyasn1.type import constraint, namedval
from pyasn1_modules.rfc2437 import *
diff --git a/pyasn1_modules/rfc3852.py b/pyasn1_modules/rfc3852.py
index 1a09335..35e3f79 100644
--- a/pyasn1_modules/rfc3852.py
+++ b/pyasn1_modules/rfc3852.py
@@ -483,13 +483,14 @@ class AttributeCertificateInfoV1(univ.Sequence):
AttributeCertificateInfoV1.componentType = namedtype.NamedTypes(
namedtype.DefaultedNamedType('version', AttCertVersionV1().subtype(value="v1")),
- namedtype.NamedType('subject', univ.Choice(componentType=namedtype.NamedTypes(
- namedtype.NamedType('baseCertificateID', rfc3281.IssuerSerial().subtype(
- explicitTag=tag.Tag(tag.tagClassContext, tag.tagFormatSimple, 0))),
- namedtype.NamedType('subjectName', rfc3280.GeneralNames().subtype(
- explicitTag=tag.Tag(tag.tagClassContext, tag.tagFormatSimple, 1)))
- ))
- ),
+ namedtype.NamedType(
+ 'subject', univ.Choice(
+ componentType=namedtype.NamedTypes(
+ namedtype.NamedType('baseCertificateID', rfc3281.IssuerSerial().subtype(explicitTag=tag.Tag(tag.tagClassContext, tag.tagFormatSimple, 0))),
+ namedtype.NamedType('subjectName', rfc3280.GeneralNames().subtype(explicitTag=tag.Tag(tag.tagClassContext, tag.tagFormatSimple, 1)))
+ )
+ )
+ ),
namedtype.NamedType('issuer', rfc3280.GeneralNames()),
namedtype.NamedType('signature', rfc3280.AlgorithmIdentifier()),
namedtype.NamedType('serialNumber', rfc3280.CertificateSerialNumber()),
diff --git a/pyasn1_modules/rfc4210.py b/pyasn1_modules/rfc4210.py
index 4e048ef..3c00369 100644
--- a/pyasn1_modules/rfc4210.py
+++ b/pyasn1_modules/rfc4210.py
@@ -141,14 +141,8 @@ class CertOrEncCert(univ.Choice):
}
"""
componentType = namedtype.NamedTypes(
- namedtype.NamedType('certificate', CMPCertificate().subtype(
- explicitTag=tag.Tag(tag.tagClassContext, tag.tagFormatConstructed, 0)
- )
- ),
- namedtype.NamedType('encryptedCert', rfc2511.EncryptedValue().subtype(
- explicitTag=tag.Tag(tag.tagClassContext, tag.tagFormatConstructed, 1)
- )
- )
+ namedtype.NamedType('certificate', CMPCertificate().subtype(explicitTag=tag.Tag(tag.tagClassContext, tag.tagFormatConstructed, 0))),
+ namedtype.NamedType('encryptedCert', rfc2511.EncryptedValue().subtype(explicitTag=tag.Tag(tag.tagClassContext, tag.tagFormatConstructed, 1)))
)
@@ -162,14 +156,8 @@ class CertifiedKeyPair(univ.Sequence):
"""
componentType = namedtype.NamedTypes(
namedtype.NamedType('certOrEncCert', CertOrEncCert()),
- namedtype.OptionalNamedType('privateKey', rfc2511.EncryptedValue().subtype(
- explicitTag=tag.Tag(tag.tagClassContext, tag.tagFormatConstructed, 0)
- )
- ),
- namedtype.OptionalNamedType('publicationInfo', rfc2511.PKIPublicationInfo().subtype(
- explicitTag=tag.Tag(tag.tagClassContext, tag.tagFormatConstructed, 1)
- )
- )
+ namedtype.OptionalNamedType('privateKey', rfc2511.EncryptedValue().subtype(explicitTag=tag.Tag(tag.tagClassContext, tag.tagFormatConstructed, 0))),
+ namedtype.OptionalNamedType('publicationInfo', rfc2511.PKIPublicationInfo().subtype(explicitTag=tag.Tag(tag.tagClassContext, tag.tagFormatConstructed, 1)))
)
@@ -358,20 +346,18 @@ class RevRepContent(univ.Sequence):
"""
componentType = namedtype.NamedTypes(
namedtype.NamedType('status', PKIStatusInfo()),
- namedtype.OptionalNamedType('revCerts', univ.SequenceOf(
- componentType=rfc2511.CertId()
- ).subtype(
- subtypeSpec=constraint.ValueSizeConstraint(1, MAX),
- explicitTag=tag.Tag(tag.tagClassContext, tag.tagFormatConstructed, 0)
- )
- ),
- namedtype.OptionalNamedType('crls', univ.SequenceOf(
- componentType=rfc2459.CertificateList()
- ).subtype(
- subtypeSpec=constraint.ValueSizeConstraint(1, MAX),
- explicitTag=tag.Tag(tag.tagClassContext, tag.tagFormatConstructed, 1)
+ namedtype.OptionalNamedType(
+ 'revCerts', univ.SequenceOf(componentType=rfc2511.CertId()).subtype(
+ subtypeSpec=constraint.ValueSizeConstraint(1, MAX),
+ explicitTag=tag.Tag(tag.tagClassContext, tag.tagFormatConstructed, 0)
+ )
+ ),
+ namedtype.OptionalNamedType(
+ 'crls', univ.SequenceOf(componentType=rfc2459.CertificateList()).subtype(
+ subtypeSpec=constraint.ValueSizeConstraint(1, MAX),
+ explicitTag=tag.Tag(tag.tagClassContext, tag.tagFormatConstructed, 1)
+ )
)
- )
)
@@ -388,24 +374,21 @@ class KeyRecRepContent(univ.Sequence):
"""
componentType = namedtype.NamedTypes(
namedtype.NamedType('status', PKIStatusInfo()),
- namedtype.OptionalNamedType('newSigCert', CMPCertificate().subtype(
- explicitTag=tag.Tag(tag.tagClassContext, tag.tagFormatConstructed, 0)
- )
- ),
- namedtype.OptionalNamedType('caCerts', univ.SequenceOf(
- componentType=CMPCertificate()
- ).subtype(
- explicitTag=tag.Tag(tag.tagClassContext, tag.tagFormatConstructed, 1),
- subtypeSpec=constraint.ValueSizeConstraint(1, MAX)
- )
- ),
- namedtype.OptionalNamedType('keyPairHist', univ.SequenceOf(
- componentType=CertifiedKeyPair()
- ).subtype(
+ namedtype.OptionalNamedType(
+ 'newSigCert', CMPCertificate().subtype(
+ explicitTag=tag.Tag(tag.tagClassContext, tag.tagFormatConstructed, 0)
+ )
+ ),
+ namedtype.OptionalNamedType(
+ 'caCerts', univ.SequenceOf(componentType=CMPCertificate()).subtype(
+ explicitTag=tag.Tag(tag.tagClassContext, tag.tagFormatConstructed, 1),
+ subtypeSpec=constraint.ValueSizeConstraint(1, MAX)
+ )
+ ),
+ namedtype.OptionalNamedType('keyPairHist', univ.SequenceOf(componentType=CertifiedKeyPair()).subtype(
explicitTag=tag.Tag(tag.tagClassContext, tag.tagFormatConstructed, 2),
- subtypeSpec=constraint.ValueSizeConstraint(1, MAX)
+ subtypeSpec=constraint.ValueSizeConstraint(1, MAX))
)
- )
)
@@ -435,16 +418,12 @@ class CertRepMessage(univ.Sequence):
}
"""
componentType = namedtype.NamedTypes(
- namedtype.OptionalNamedType('caPubs', univ.SequenceOf(
- componentType=CMPCertificate()
- ).subtype(
- subtypeSpec=constraint.ValueSizeConstraint(1, MAX),
- explicitTag=tag.Tag(tag.tagClassContext, tag.tagFormatConstructed, 1)
- )
- ),
- namedtype.NamedType('response', univ.SequenceOf(
- componentType=CertResponse())
- )
+ namedtype.OptionalNamedType(
+ 'caPubs', univ.SequenceOf(
+ componentType=CMPCertificate()
+ ).subtype(subtypeSpec=constraint.ValueSizeConstraint(1, MAX), explicitTag=tag.Tag(tag.tagClassContext, tag.tagFormatConstructed, 1))
+ ),
+ namedtype.NamedType('response', univ.SequenceOf(componentType=CertResponse()))
)
@@ -461,15 +440,12 @@ class OOBCertHash(univ.Sequence):
}
"""
componentType = namedtype.NamedTypes(
- namedtype.OptionalNamedType('hashAlg',
- rfc2459.AlgorithmIdentifier().subtype(
- explicitTag=tag.Tag(tag.tagClassContext, tag.tagFormatConstructed, 0)
- )
- ),
- namedtype.OptionalNamedType('certId', rfc2511.CertId().subtype(
- explicitTag=tag.Tag(tag.tagClassContext, tag.tagFormatConstructed, 1)
- )
- ),
+ namedtype.OptionalNamedType(
+ 'hashAlg', rfc2459.AlgorithmIdentifier().subtype(explicitTag=tag.Tag(tag.tagClassContext, tag.tagFormatConstructed, 0))
+ ),
+ namedtype.OptionalNamedType(
+ 'certId', rfc2511.CertId().subtype(explicitTag=tag.Tag(tag.tagClassContext, tag.tagFormatConstructed, 1))
+ ),
namedtype.NamedType('hashVal', univ.BitString())
)
@@ -511,10 +487,9 @@ class PBMParameter(univ.Sequence):
}
"""
componentType = namedtype.NamedTypes(
- namedtype.NamedType('salt', univ.OctetString().subtype(
- subtypeSpec=constraint.ValueSizeConstraint(0, 128)
- )
- ),
+ namedtype.NamedType(
+ 'salt', univ.OctetString().subtype(subtypeSpec=constraint.ValueSizeConstraint(0, 128))
+ ),
namedtype.NamedType('owf', rfc2459.AlgorithmIdentifier()),
namedtype.NamedType('iterationCount', univ.Integer()),
namedtype.NamedType('mac', rfc2459.AlgorithmIdentifier())
@@ -567,115 +542,143 @@ class PKIBody(univ.Choice):
"""
componentType = namedtype.NamedTypes(
- namedtype.NamedType('ir', rfc2511.CertReqMessages().subtype(
- explicitTag=tag.Tag(tag.tagClassContext, tag.tagFormatConstructed, 0)
- )
- ),
- namedtype.NamedType('ip', CertRepMessage().subtype(
- explicitTag=tag.Tag(tag.tagClassContext, tag.tagFormatConstructed, 1)
- )
- ),
- namedtype.NamedType('cr', rfc2511.CertReqMessages().subtype(
- explicitTag=tag.Tag(tag.tagClassContext, tag.tagFormatConstructed, 2)
- )
- ),
- namedtype.NamedType('cp', CertRepMessage().subtype(
- explicitTag=tag.Tag(tag.tagClassContext, tag.tagFormatConstructed, 3)
- )
- ),
- namedtype.NamedType('p10cr', rfc2314.CertificationRequest().subtype(
- explicitTag=tag.Tag(tag.tagClassContext, tag.tagFormatConstructed, 4)
- )
- ),
- namedtype.NamedType('popdecc', POPODecKeyChallContent().subtype(
- explicitTag=tag.Tag(tag.tagClassContext, tag.tagFormatConstructed, 5)
- )
- ),
- namedtype.NamedType('popdecr', POPODecKeyRespContent().subtype(
- explicitTag=tag.Tag(tag.tagClassContext, tag.tagFormatConstructed, 6)
- )
- ),
- namedtype.NamedType('kur', rfc2511.CertReqMessages().subtype(
- explicitTag=tag.Tag(tag.tagClassContext, tag.tagFormatConstructed, 7)
- )
- ),
- namedtype.NamedType('kup', CertRepMessage().subtype(
- explicitTag=tag.Tag(tag.tagClassContext, tag.tagFormatConstructed, 8)
- )
- ),
- namedtype.NamedType('krr', rfc2511.CertReqMessages().subtype(
- explicitTag=tag.Tag(tag.tagClassContext, tag.tagFormatConstructed, 9)
- )
- ),
- namedtype.NamedType('krp', KeyRecRepContent().subtype(
- explicitTag=tag.Tag(tag.tagClassContext, tag.tagFormatConstructed, 10)
- )
- ),
- namedtype.NamedType('rr', RevReqContent().subtype(
- explicitTag=tag.Tag(tag.tagClassContext, tag.tagFormatConstructed, 11)
- )
- ),
- namedtype.NamedType('rp', RevRepContent().subtype(
- explicitTag=tag.Tag(tag.tagClassContext, tag.tagFormatConstructed, 12)
- )
- ),
- namedtype.NamedType('ccr', rfc2511.CertReqMessages().subtype(
- explicitTag=tag.Tag(tag.tagClassContext, tag.tagFormatConstructed, 13)
- )
- ),
- namedtype.NamedType('ccp', CertRepMessage().subtype(
- explicitTag=tag.Tag(tag.tagClassContext, tag.tagFormatConstructed, 14)
- )
- ),
- namedtype.NamedType('ckuann', CAKeyUpdAnnContent().subtype(
- explicitTag=tag.Tag(tag.tagClassContext, tag.tagFormatConstructed, 15)
- )
- ),
- namedtype.NamedType('cann', CertAnnContent().subtype(
- explicitTag=tag.Tag(tag.tagClassContext, tag.tagFormatConstructed, 16)
- )
- ),
- namedtype.NamedType('rann', RevAnnContent().subtype(
- explicitTag=tag.Tag(tag.tagClassContext, tag.tagFormatConstructed, 17)
- )
- ),
- namedtype.NamedType('crlann', CRLAnnContent().subtype(
- explicitTag=tag.Tag(tag.tagClassContext, tag.tagFormatConstructed, 18)
- )
- ),
- namedtype.NamedType('pkiconf', PKIConfirmContent().subtype(
- explicitTag=tag.Tag(tag.tagClassContext, tag.tagFormatConstructed, 19)
- )
- ),
- namedtype.NamedType('nested', nestedMessageContent),
+ namedtype.NamedType(
+ 'ir', rfc2511.CertReqMessages().subtype(
+ explicitTag=tag.Tag(tag.tagClassContext, tag.tagFormatConstructed, 0)
+ )
+ ),
+ namedtype.NamedType(
+ 'ip', CertRepMessage().subtype(
+ explicitTag=tag.Tag(tag.tagClassContext, tag.tagFormatConstructed, 1)
+ )
+ ),
+ namedtype.NamedType(
+ 'cr', rfc2511.CertReqMessages().subtype(
+ explicitTag=tag.Tag(tag.tagClassContext, tag.tagFormatConstructed, 2)
+ )
+ ),
+ namedtype.NamedType(
+ 'cp', CertRepMessage().subtype(
+ explicitTag=tag.Tag(tag.tagClassContext, tag.tagFormatConstructed, 3)
+ )
+ ),
+ namedtype.NamedType(
+ 'p10cr', rfc2314.CertificationRequest().subtype(
+ explicitTag=tag.Tag(tag.tagClassContext, tag.tagFormatConstructed, 4)
+ )
+ ),
+ namedtype.NamedType(
+ 'popdecc', POPODecKeyChallContent().subtype(
+ explicitTag=tag.Tag(tag.tagClassContext, tag.tagFormatConstructed, 5)
+ )
+ ),
+ namedtype.NamedType(
+ 'popdecr', POPODecKeyRespContent().subtype(
+ explicitTag=tag.Tag(tag.tagClassContext, tag.tagFormatConstructed, 6)
+ )
+ ),
+ namedtype.NamedType(
+ 'kur', rfc2511.CertReqMessages().subtype(
+ explicitTag=tag.Tag(tag.tagClassContext, tag.tagFormatConstructed, 7)
+ )
+ ),
+ namedtype.NamedType(
+ 'kup', CertRepMessage().subtype(
+ explicitTag=tag.Tag(tag.tagClassContext, tag.tagFormatConstructed, 8)
+ )
+ ),
+ namedtype.NamedType(
+ 'krr', rfc2511.CertReqMessages().subtype(
+ explicitTag=tag.Tag(tag.tagClassContext, tag.tagFormatConstructed, 9)
+ )
+ ),
+ namedtype.NamedType(
+ 'krp', KeyRecRepContent().subtype(
+ explicitTag=tag.Tag(tag.tagClassContext, tag.tagFormatConstructed, 10)
+ )
+ ),
+ namedtype.NamedType(
+ 'rr', RevReqContent().subtype(
+ explicitTag=tag.Tag(tag.tagClassContext, tag.tagFormatConstructed, 11)
+ )
+ ),
+ namedtype.NamedType(
+ 'rp', RevRepContent().subtype(
+ explicitTag=tag.Tag(tag.tagClassContext, tag.tagFormatConstructed, 12)
+ )
+ ),
+ namedtype.NamedType(
+ 'ccr', rfc2511.CertReqMessages().subtype(
+ explicitTag=tag.Tag(tag.tagClassContext, tag.tagFormatConstructed, 13)
+ )
+ ),
+ namedtype.NamedType(
+ 'ccp', CertRepMessage().subtype(
+ explicitTag=tag.Tag(tag.tagClassContext, tag.tagFormatConstructed, 14)
+ )
+ ),
+ namedtype.NamedType(
+ 'ckuann', CAKeyUpdAnnContent().subtype(
+ explicitTag=tag.Tag(tag.tagClassContext, tag.tagFormatConstructed, 15)
+ )
+ ),
+ namedtype.NamedType(
+ 'cann', CertAnnContent().subtype(
+ explicitTag=tag.Tag(tag.tagClassContext, tag.tagFormatConstructed, 16)
+ )
+ ),
+ namedtype.NamedType(
+ 'rann', RevAnnContent().subtype(
+ explicitTag=tag.Tag(tag.tagClassContext, tag.tagFormatConstructed, 17)
+ )
+ ),
+ namedtype.NamedType(
+ 'crlann', CRLAnnContent().subtype(
+ explicitTag=tag.Tag(tag.tagClassContext, tag.tagFormatConstructed, 18)
+ )
+ ),
+ namedtype.NamedType(
+ 'pkiconf', PKIConfirmContent().subtype(
+ explicitTag=tag.Tag(tag.tagClassContext, tag.tagFormatConstructed, 19)
+ )
+ ),
+ namedtype.NamedType(
+ 'nested', nestedMessageContent
+ ),
# namedtype.NamedType('nested', NestedMessageContent().subtype(
# explicitTag=tag.Tag(tag.tagClassContext,tag.tagFormatConstructed,20)
# )
# ),
- namedtype.NamedType('genm', GenMsgContent().subtype(
- explicitTag=tag.Tag(tag.tagClassContext, tag.tagFormatConstructed, 21)
- )
- ),
- namedtype.NamedType('gen', GenRepContent().subtype(
- explicitTag=tag.Tag(tag.tagClassContext, tag.tagFormatConstructed, 22)
- )
- ),
- namedtype.NamedType('error', ErrorMsgContent().subtype(
- explicitTag=tag.Tag(tag.tagClassContext, tag.tagFormatConstructed, 23)
- )
- ),
- namedtype.NamedType('certConf', CertConfirmContent().subtype(
- explicitTag=tag.Tag(tag.tagClassContext, tag.tagFormatConstructed, 24)
- )
- ),
- namedtype.NamedType('pollReq', PollReqContent().subtype(
- explicitTag=tag.Tag(tag.tagClassContext, tag.tagFormatConstructed, 25)
- )
- ),
- namedtype.NamedType('pollRep', PollRepContent().subtype(
- explicitTag=tag.Tag(tag.tagClassContext, tag.tagFormatConstructed, 26)
+ namedtype.NamedType(
+ 'genm', GenMsgContent().subtype(
+ explicitTag=tag.Tag(tag.tagClassContext, tag.tagFormatConstructed, 21)
+ )
+ ),
+ namedtype.NamedType(
+ 'gen', GenRepContent().subtype(
+ explicitTag=tag.Tag(tag.tagClassContext, tag.tagFormatConstructed, 22)
+ )
+ ),
+ namedtype.NamedType(
+ 'error', ErrorMsgContent().subtype(
+ explicitTag=tag.Tag(tag.tagClassContext, tag.tagFormatConstructed, 23)
+ )
+ ),
+ namedtype.NamedType(
+ 'certConf', CertConfirmContent().subtype(
+ explicitTag=tag.Tag(tag.tagClassContext, tag.tagFormatConstructed, 24)
+ )
+ ),
+ namedtype.NamedType(
+ 'pollReq', PollReqContent().subtype(
+ explicitTag=tag.Tag(tag.tagClassContext, tag.tagFormatConstructed, 25)
+ )
+ ),
+ namedtype.NamedType(
+ 'pollRep', PollRepContent().subtype(
+ explicitTag=tag.Tag(tag.tagClassContext, tag.tagFormatConstructed, 26)
+ )
)
- )
)
@@ -699,13 +702,11 @@ class PKIHeader(univ.Sequence):
"""
componentType = namedtype.NamedTypes(
- namedtype.NamedType('pvno', univ.Integer(
- namedValues=namedval.NamedValues(
- ('cmp1999', 1),
- ('cmp2000', 2)
+ namedtype.NamedType(
+ 'pvno', univ.Integer(
+ namedValues=namedval.NamedValues(('cmp1999', 1), ('cmp2000', 2))
)
- )
- ),
+ ),
namedtype.NamedType('sender', rfc2459.GeneralName()),
namedtype.NamedType('recipient', rfc2459.GeneralName()),
namedtype.OptionalNamedType('messageTime', useful.GeneralizedTime().subtype(
diff --git a/pyasn1_modules/rfc4211.py b/pyasn1_modules/rfc4211.py
index 6404e17..4484358 100644
--- a/pyasn1_modules/rfc4211.py
+++ b/pyasn1_modules/rfc4211.py
@@ -68,12 +68,18 @@ class POPOSigningKeyInput(univ.Sequence):
POPOSigningKeyInput.componentType = namedtype.NamedTypes(
- namedtype.NamedType('authInfo', univ.Choice(componentType=namedtype.NamedTypes(
- namedtype.NamedType('sender', rfc3280.GeneralName().subtype(
- implicitTag=tag.Tag(tag.tagClassContext, tag.tagFormatConstructed, 0))),
- namedtype.NamedType('publicKeyMAC', PKMACValue())
- ))
- ),
+ namedtype.NamedType(
+ 'authInfo', univ.Choice(
+ componentType=namedtype.NamedTypes(
+ namedtype.NamedType(
+ 'sender', rfc3280.GeneralName().subtype(implicitTag=tag.Tag(tag.tagClassContext, tag.tagFormatConstructed, 0))
+ ),
+ namedtype.NamedType(
+ 'publicKeyMAC', PKMACValue()
+ )
+ )
+ )
+ ),
namedtype.NamedType('publicKey', rfc3280.SubjectPublicKeyInfo())
)
@@ -342,11 +348,14 @@ class EncKeyWithID(univ.Sequence):
EncKeyWithID.componentType = namedtype.NamedTypes(
namedtype.NamedType('privateKey', PrivateKeyInfo()),
- namedtype.OptionalNamedType('identifier', univ.Choice(componentType=namedtype.NamedTypes(
- namedtype.NamedType('string', char.UTF8String()),
- namedtype.NamedType('generalName', rfc3280.GeneralName())
- ))
- )
+ namedtype.OptionalNamedType(
+ 'identifier', univ.Choice(
+ componentType=namedtype.NamedTypes(
+ namedtype.NamedType('string', char.UTF8String()),
+ namedtype.NamedType('generalName', rfc3280.GeneralName())
+ )
+ )
+ )
)
id_regCtrl_protocolEncrKey = _buildOid(id_regCtrl, 6)
diff --git a/pyasn1_modules/rfc5280.py b/pyasn1_modules/rfc5280.py
index 6261cdf..b5e7407 100644
--- a/pyasn1_modules/rfc5280.py
+++ b/pyasn1_modules/rfc5280.py
@@ -347,15 +347,19 @@ TBSCertList.componentType = namedtype.NamedTypes(
namedtype.NamedType('issuer', Name()),
namedtype.NamedType('thisUpdate', Time()),
namedtype.OptionalNamedType('nextUpdate', Time()),
- namedtype.OptionalNamedType('revokedCertificates',
- univ.SequenceOf(componentType=univ.Sequence(componentType=namedtype.NamedTypes(
- namedtype.NamedType('userCertificate', CertificateSerialNumber()),
- namedtype.NamedType('revocationDate', Time()),
- namedtype.OptionalNamedType('crlEntryExtensions', Extensions())
- ))
- )),
- namedtype.OptionalNamedType('crlExtensions',
- Extensions().subtype(explicitTag=tag.Tag(tag.tagClassContext, tag.tagFormatSimple, 0)))
+ namedtype.OptionalNamedType(
+ 'revokedCertificates', univ.SequenceOf(
+ componentType=univ.Sequence(
+ componentType=namedtype.NamedTypes(
+ namedtype.NamedType('userCertificate', CertificateSerialNumber()),
+ namedtype.NamedType('revocationDate', Time()),
+ namedtype.OptionalNamedType('crlEntryExtensions', Extensions())
+ )
+ )
+ )
+ ),
+ namedtype.OptionalNamedType(
+ 'crlExtensions', Extensions().subtype(explicitTag=tag.Tag(tag.tagClassContext, tag.tagFormatSimple, 0)))
)
@@ -582,15 +586,14 @@ class ExtendedNetworkAddress(univ.Choice):
ExtendedNetworkAddress.componentType = namedtype.NamedTypes(
- namedtype.NamedType('e163-4-address', univ.Sequence(componentType=namedtype.NamedTypes(
- namedtype.NamedType('number', char.NumericString().subtype(
- subtypeSpec=constraint.ValueSizeConstraint(1, ub_e163_4_number_length)).subtype(
- implicitTag=tag.Tag(tag.tagClassContext, tag.tagFormatSimple, 0))),
- namedtype.OptionalNamedType('sub-address', char.NumericString().subtype(
- subtypeSpec=constraint.ValueSizeConstraint(1, ub_e163_4_sub_address_length)).subtype(
- implicitTag=tag.Tag(tag.tagClassContext, tag.tagFormatSimple, 1)))
- ))
- ),
+ namedtype.NamedType(
+ 'e163-4-address', univ.Sequence(
+ componentType=namedtype.NamedTypes(
+ namedtype.NamedType('number', char.NumericString().subtype(subtypeSpec=constraint.ValueSizeConstraint(1, ub_e163_4_number_length)).subtype(implicitTag=tag.Tag(tag.tagClassContext, tag.tagFormatSimple, 0))),
+ namedtype.OptionalNamedType('sub-address', char.NumericString().subtype(subtypeSpec=constraint.ValueSizeConstraint(1, ub_e163_4_sub_address_length)).subtype(implicitTag=tag.Tag(tag.tagClassContext, tag.tagFormatSimple, 1)))
+ )
+ )
+ ),
namedtype.NamedType('psap-address', PresentationAddress().subtype(
implicitTag=tag.Tag(tag.tagClassContext, tag.tagFormatConstructed, 0)))
)
@@ -1369,10 +1372,12 @@ class PolicyMappings(univ.SequenceOf):
pass
-PolicyMappings.componentType = univ.Sequence(componentType=namedtype.NamedTypes(
- namedtype.NamedType('issuerDomainPolicy', CertPolicyId()),
- namedtype.NamedType('subjectDomainPolicy', CertPolicyId())
-))
+PolicyMappings.componentType = univ.Sequence(
+ componentType=namedtype.NamedTypes(
+ namedtype.NamedType('issuerDomainPolicy', CertPolicyId()),
+ namedtype.NamedType('subjectDomainPolicy', CertPolicyId())
+ )
+)
PolicyMappings.subtypeSpec = constraint.ValueSizeConstraint(1, MAX)
diff --git a/pyasn1_modules/rfc5652.py b/pyasn1_modules/rfc5652.py
index 03f5b84..2b38ccc 100644
--- a/pyasn1_modules/rfc5652.py
+++ b/pyasn1_modules/rfc5652.py
@@ -50,13 +50,14 @@ class AttributeCertificateInfoV1(univ.Sequence):
AttributeCertificateInfoV1.componentType = namedtype.NamedTypes(
namedtype.DefaultedNamedType('version', AttCertVersionV1().subtype(value="v1")),
- namedtype.NamedType('subject', univ.Choice(componentType=namedtype.NamedTypes(
- namedtype.NamedType('baseCertificateID', rfc3281.IssuerSerial().subtype(
- explicitTag=tag.Tag(tag.tagClassContext, tag.tagFormatSimple, 0))),
- namedtype.NamedType('subjectName', rfc5280.GeneralNames().subtype(
- explicitTag=tag.Tag(tag.tagClassContext, tag.tagFormatSimple, 1)))
- ))
- ),
+ namedtype.NamedType(
+ 'subject', univ.Choice(
+ componentType=namedtype.NamedTypes(
+ namedtype.NamedType('baseCertificateID', rfc3281.IssuerSerial().subtype(explicitTag=tag.Tag(tag.tagClassContext, tag.tagFormatSimple, 0))),
+ namedtype.NamedType('subjectName', rfc5280.GeneralNames().subtype(explicitTag=tag.Tag(tag.tagClassContext, tag.tagFormatSimple, 1)))
+ )
+ )
+ ),
namedtype.NamedType('issuer', rfc5280.GeneralNames()),
namedtype.NamedType('signature', rfc5280.AlgorithmIdentifier()),
namedtype.NamedType('serialNumber', rfc5280.CertificateSerialNumber()),
diff --git a/pyasn1_modules/rfc6402.py b/pyasn1_modules/rfc6402.py
index 8ff105a..2d5e426 100644
--- a/pyasn1_modules/rfc6402.py
+++ b/pyasn1_modules/rfc6402.py
@@ -127,16 +127,21 @@ CMCStatusInfoV2.componentType = namedtype.NamedTypes(
namedtype.NamedType('cMCStatus', CMCStatus()),
namedtype.NamedType('bodyList', univ.SequenceOf(componentType=BodyPartReference())),
namedtype.OptionalNamedType('statusString', char.UTF8String()),
- namedtype.OptionalNamedType('otherInfo', univ.Choice(componentType=namedtype.NamedTypes(
- namedtype.NamedType('failInfo', CMCFailInfo()),
- namedtype.NamedType('pendInfo', PendInfo()),
- namedtype.NamedType('extendedFailInfo', univ.Sequence(componentType=namedtype.NamedTypes(
- namedtype.NamedType('failInfoOID', univ.ObjectIdentifier()),
- namedtype.NamedType('failInfoValue', AttributeValue())
- ))
- )
- ))
- )
+ namedtype.OptionalNamedType(
+ 'otherInfo', univ.Choice(
+ componentType=namedtype.NamedTypes(
+ namedtype.NamedType('failInfo', CMCFailInfo()),
+ namedtype.NamedType('pendInfo', PendInfo()),
+ namedtype.NamedType(
+ 'extendedFailInfo', univ.Sequence(
+ componentType=namedtype.NamedTypes(
+ namedtype.NamedType('failInfoOID', univ.ObjectIdentifier()),
+ namedtype.NamedType('failInfoValue', AttributeValue()))
+ )
+ )
+ )
+ )
+ )
)
@@ -193,18 +198,27 @@ class CertificationRequest(univ.Sequence):
CertificationRequest.componentType = namedtype.NamedTypes(
- namedtype.NamedType('certificationRequestInfo', univ.Sequence(componentType=namedtype.NamedTypes(
- namedtype.NamedType('version', univ.Integer()),
- namedtype.NamedType('subject', rfc5280.Name()),
- namedtype.NamedType('subjectPublicKeyInfo', univ.Sequence(componentType=namedtype.NamedTypes(
- namedtype.NamedType('algorithm', rfc5280.AlgorithmIdentifier()),
- namedtype.NamedType('subjectPublicKey', univ.BitString())
- ))
- ),
- namedtype.NamedType('attributes', univ.SetOf(componentType=rfc5652.Attribute()).subtype(
- implicitTag=tag.Tag(tag.tagClassContext, tag.tagFormatSimple, 0)))
- ))
- ),
+ namedtype.NamedType(
+ 'certificationRequestInfo', univ.Sequence(
+ componentType=namedtype.NamedTypes(
+ namedtype.NamedType('version', univ.Integer()),
+ namedtype.NamedType('subject', rfc5280.Name()),
+ namedtype.NamedType(
+ 'subjectPublicKeyInfo', univ.Sequence(
+ componentType=namedtype.NamedTypes(
+ namedtype.NamedType('algorithm', rfc5280.AlgorithmIdentifier()),
+ namedtype.NamedType('subjectPublicKey', univ.BitString())
+ )
+ )
+ ),
+ namedtype.NamedType(
+ 'attributes', univ.SetOf(
+ componentType=rfc5652.Attribute()).subtype(
+ implicitTag=tag.Tag(tag.tagClassContext, tag.tagFormatSimple, 0))
+ )
+ )
+ )
+ ),
namedtype.NamedType('signatureAlgorithm', rfc5280.AlgorithmIdentifier()),
namedtype.NamedType('signature', univ.BitString())
)
@@ -331,11 +345,14 @@ CMCStatusInfo.componentType = namedtype.NamedTypes(
namedtype.NamedType('cMCStatus', CMCStatus()),
namedtype.NamedType('bodyList', univ.SequenceOf(componentType=BodyPartID())),
namedtype.OptionalNamedType('statusString', char.UTF8String()),
- namedtype.OptionalNamedType('otherInfo', univ.Choice(componentType=namedtype.NamedTypes(
- namedtype.NamedType('failInfo', CMCFailInfo()),
- namedtype.NamedType('pendInfo', PendInfo())
- ))
- )
+ namedtype.OptionalNamedType(
+ 'otherInfo', univ.Choice(
+ componentType=namedtype.NamedTypes(
+ namedtype.NamedType('failInfo', CMCFailInfo()),
+ namedtype.NamedType('pendInfo', PendInfo())
+ )
+ )
+ )
)