class QCStatement(univ.Sequence): componentType = namedtype.NamedTypes( namedtype.NamedType('statementId', univ.ObjectIdentifier()), namedtype.OptionalNamedType('statementInfo', univ.Any(), openType=opentype.OpenType( 'statementId', qcStatementMap)))
class EncryptionInfo(univ.Sequence): componentType = namedtype.NamedTypes( namedtype.NamedType('encryptionInfoType', univ.ObjectIdentifier()), namedtype.NamedType('encryptionInfoValue', univ.Any(), openType=opentype.OpenType('encryptionInfoType', ersEncryptionInfoValueMap)) )
class OtherRevInfo(univ.Sequence): componentType = namedtype.NamedTypes( namedtype.NamedType('riType', univ.ObjectIdentifier()), namedtype.NamedType('riValue', univ.Any(), openType=opentype.OpenType( 'riType', rfc5652.otherRevInfoFormatMap)))
class Attribute(univ.Sequence): componentType = namedtype.NamedTypes( namedtype.NamedType('type', AttributeType()), namedtype.NamedType('values', univ.SetOf(componentType=AttributeValue()), openType=opentype.OpenType( 'type', certificateAttributesMap)))
class ValidationPolRef(univ.Sequence): componentType = namedtype.NamedTypes( namedtype.NamedType('valPolId', univ.ObjectIdentifier()), namedtype.OptionalNamedType('valPolParams', univ.Any(), openType=opentype.OpenType( 'valPolId', scvpValidationPolMap)))
class Extension(univ.Sequence): componentType = namedtype.NamedTypes( namedtype.NamedType('extnID', univ.ObjectIdentifier()), namedtype.DefaultedNamedType('critical', univ.Boolean('False')), namedtype.NamedType('extnValue', univ.OctetString(), openType=opentype.OpenType('extnID', certificateExtensionsMap)) )
class OtherEvidence(univ.Sequence): componentType = namedtype.NamedTypes( namedtype.NamedType('oeType', univ.ObjectIdentifier()), namedtype.NamedType('oeValue', univ.Any(), openType=opentype.OpenType('oeType', otherEvidenceMap)))
class GLAQueryResponse(univ.Sequence): componentType = namedtype.NamedTypes( namedtype.NamedType('glaResponseType', univ.ObjectIdentifier()), namedtype.NamedType('glaResponseValue', univ.Any(), openType=opentype.OpenType('glaResponseType', glaQueryRRMap)))
class ValidationAlg(univ.Sequence): componentType = namedtype.NamedTypes( namedtype.NamedType('valAlgId', univ.ObjectIdentifier()), namedtype.OptionalNamedType('parameters', univ.Any(), openType=opentype.OpenType( 'valPolId', scvpValidationAlgMap)))
class AttributeValueAssertion(univ.Sequence): componentType = namedtype.NamedTypes( namedtype.NamedType('attributeType', AttributeType()), namedtype.NamedType('attributeValue', AttributeValue(), openType=opentype.OpenType( 'type', certificateAttributesMap)))
class OtherRevVals(univ.Sequence): componentType = namedtype.NamedTypes( namedtype.NamedType('otherRevValType', OtherRevValType()), namedtype.NamedType('otherRevVals', univ.Any(), openType=opentype.OpenType('otherRevValType', otherRevValMap)))
class SigPolicyQualifierInfo(univ.Sequence): componentType = namedtype.NamedTypes( namedtype.NamedType('sigPolicyQualifierId', SigPolicyQualifierId()), namedtype.NamedType('sigQualifier', univ.Any(), openType=opentype.OpenType('sigPolicyQualifierId', sigQualifiersMap)))
class CommitmentTypeQualifier(univ.Sequence): componentType = namedtype.NamedTypes( namedtype.NamedType('commitmentTypeIdentifier', CommitmentTypeIdentifier()), namedtype.NamedType('qualifier', univ.Any(), openType=opentype.OpenType('commitmentTypeIdentifier', commitmentQualifierMap)) )
class PolicyQualifierInfo(univ.Sequence): componentType = namedtype.NamedTypes( namedtype.NamedType('policyQualifierId', PolicyQualifierId()), namedtype.NamedType( 'qualifier', univ.Any(), openType=opentype.OpenType('policyQualifierId', policyQualifierInfoMap) ) )
def setUp(self): openType = opentype.OpenType('id', { 1: univ.Integer(), 2: univ.OctetString() }) self.s = univ.Sequence(componentType=namedtype.NamedTypes( namedtype.NamedType('id', univ.Integer()), namedtype.NamedType('blob', univ.Any(), openType=openType)))
class ContentInfo(univ.Sequence): componentType = namedtype.NamedTypes( namedtype.NamedType('contentType', ContentType()), namedtype.OptionalNamedType( 'content', univ.Any().subtype(explicitTag=tag.Tag( tag.tagClassContext, tag.tagFormatConstructed, 0)), openType=opentype.OpenType('contentType', contentTypeMap)))
class AnotherName(univ.Sequence): componentType = namedtype.NamedTypes( namedtype.NamedType('type-id', univ.ObjectIdentifier()), namedtype.NamedType( 'value', univ.Any().subtype(explicitTag=tag.Tag(tag.tagClassContext, tag.tagFormatSimple, 0)), openType=opentype.OpenType('type-id', anotherNameMap) ) )
class EncryptedContentInfo(univ.Sequence): componentType = namedtype.NamedTypes( namedtype.NamedType('contentType', ContentType()), namedtype.NamedType('contentEncryptionAlgorithm', ContentEncryptionAlgorithmIdentifier()), namedtype.OptionalNamedType( 'encryptedContent', EncryptedContent().subtype(implicitTag=tag.Tag( tag.tagClassContext, tag.tagFormatConstructed, 0)), openType=opentype.OpenType('contentType', contentTypeMap)))
class SecurityCategory(univ.Sequence): componentType = namedtype.NamedTypes( namedtype.NamedType('type', univ.ObjectIdentifier().subtype(implicitTag=tag.Tag( tag.tagClassContext, tag.tagFormatSimple, 0))), namedtype.NamedType('value', univ.Any().subtype(implicitTag=tag.Tag( tag.tagClassContext, tag.tagFormatSimple, 1)), openType=opentype.OpenType('type', securityCategoryMap)) )
class ExtensionAttribute(univ.Sequence): componentType = namedtype.NamedTypes( namedtype.NamedType( 'extension-attribute-type', univ.Integer().subtype(subtypeSpec=constraint.ValueRangeConstraint(0, ub_extension_attributes)).subtype(implicitTag=tag.Tag(tag.tagClassContext, tag.tagFormatSimple, 0))), namedtype.NamedType( 'extension-attribute-value', univ.Any().subtype(explicitTag=tag.Tag(tag.tagClassContext, tag.tagFormatSimple, 1)), openType=opentype.OpenType('type', certificateExtensionsMap)) )
def setUp(self): openType = opentype.OpenType('id', { 1: univ.Integer(), 2: univ.OctetString() }) self.s = univ.Sequence(componentType=namedtype.NamedTypes( namedtype.NamedType('id', univ.Integer()), namedtype.NamedType('blob', univ.Any().subtype(explicitTag=tag.Tag( tag.tagClassContext, tag.tagFormatSimple, 3)), openType=openType)))
class InfoTypeAndValue(univ.Sequence): """ InfoTypeAndValue ::= SEQUENCE { infoType OBJECT IDENTIFIER, infoValue ANY DEFINED BY infoType OPTIONAL } """ componentType = namedtype.NamedTypes( namedtype.NamedType('infoType', univ.ObjectIdentifier()), namedtype.OptionalNamedType('infoValue', univ.Any(), openType=opentype.OpenType( 'infoType', infoTypeAndValueMap)))
pass SingleAttributeValues.componentType = AttributeValue() class SingleAttribute(univ.Sequence): pass SingleAttribute.componentType = namedtype.NamedTypes( namedtype.NamedType('type', AttributeType()), namedtype.NamedType('values', AttributeValues().subtype( sizeSpec=constraint.ValueSizeConstraint(1, 1)), openType=opentype.OpenType('type', certificateAttributesMap))) # CMSAttribute is the same as Attribute in RFC 5652, and CMSSingleAttribute # is the companion where the attrValues SET must have one and only one member CMSAttribute = rfc5652.Attribute class CMSSingleAttribute(univ.Sequence): pass CMSSingleAttribute.componentType = namedtype.NamedTypes( namedtype.NamedType('attrType', AttributeType()), namedtype.NamedType('attrValues', AttributeValues().subtype(
pass SingleAttributeValues.componentType = AttributeValue() class SingleAttribute(univ.Sequence): pass SingleAttribute.componentType = namedtype.NamedTypes( namedtype.NamedType('type', AttributeType()), namedtype.NamedType('values', AttributeValues().subtype( sizeSpec=constraint.ValueSizeConstraint(1, 1)), openType=opentype.OpenType( 'type', rfc5280.certificateAttributesMap))) # CMSAttribute is the same as Attribute in RFC 5652, and CMSSingleAttribute # is the companion where the attrValues SET must have one and only one member CMSAttribute = rfc5652.Attribute class CMSSingleAttribute(univ.Sequence): pass CMSSingleAttribute.componentType = namedtype.NamedTypes( namedtype.NamedType('attrType', AttributeType()), namedtype.NamedType('attrValues', AttributeValues().subtype(
class AttributeValues(univ.SetOf): pass AttributeValues.componentType = AttributeValue() AttributeValues.sizeSpec = univ.Set.sizeSpec + constraint.ValueSizeConstraint(1, 1) class SingleAttribute(univ.Sequence): pass SingleAttribute.componentType = namedtype.NamedTypes( namedtype.NamedType('attrType', univ.ObjectIdentifier()), namedtype.NamedType('attrValues', AttributeValues(), openType=opentype.OpenType('attrType', rfc5652.cmsAttributesMap) ) ) # SIR Entity Name class SIREntityNameType(univ.ObjectIdentifier): pass class SIREntityNameValue(univ.Any): pass class SIREntityName(univ.Sequence):
class Sequence(univ.Sequence): componentType = namedtype.NamedTypes( namedtype.NamedType('id', univ.Integer()), namedtype.NamedType('blob', self.taggedAny, openType=opentype.OpenType(name='id')))
namedtype.NamedType('signature', univ.BitString()) ) class AttributeValue(univ.Any): pass class Attribute(univ.Sequence): pass Attribute.componentType = namedtype.NamedTypes( namedtype.NamedType('attrType', univ.ObjectIdentifier()), namedtype.NamedType('attrValues', univ.SetOf(componentType=AttributeValue()), openType=opentype.OpenType('attrType', cmsAttributesMap) ) ) class SignedAttributes(univ.SetOf): pass SignedAttributes.componentType = Attribute() SignedAttributes.sizeSpec = constraint.ValueSizeConstraint(1, MAX) class AttributeCertificateV2(rfc3281.AttributeCertificate): pass
id_cmc_addExtensions = _buildOid(id_cmc, 8) id_cmc_modCertTemplate = _buildOid(id_cmc, 31) class TaggedAttribute(univ.Sequence): pass TaggedAttribute.componentType = namedtype.NamedTypes( namedtype.NamedType('bodyPartID', BodyPartID()), namedtype.NamedType('attrType', univ.ObjectIdentifier()), namedtype.NamedType('attrValues', univ.SetOf(componentType=AttributeValue()), openType=opentype.OpenType('attrType', cmcControlAttributesMap))) class OtherMsg(univ.Sequence): pass OtherMsg.componentType = namedtype.NamedTypes( namedtype.NamedType('bodyPartID', BodyPartID()), namedtype.NamedType('otherMsgType', univ.ObjectIdentifier()), namedtype.NamedType('otherMsgValue', univ.Any())) class PKIData(univ.Sequence): pass
pass AttributeValues.componentType = AttributeValue() class CMSSingleAttribute(univ.Sequence): pass CMSSingleAttribute.componentType = namedtype.NamedTypes( namedtype.NamedType('attrType', AttributeType()), namedtype.NamedType('attrValues', AttributeValues().subtype( sizeSpec=constraint.ValueSizeConstraint(1, 1)), openType=opentype.OpenType('attrType', cmsAttributesMap))) # Object identifier arcs rsadsi = _OID(1, 2, 840, 113549) pkcs = _OID(rsadsi, 1) pkcs_9 = _OID(pkcs, 9) certTypes = _OID(pkcs_9, 22) crlTypes = _OID(pkcs_9, 23) pkcs_12 = _OID(pkcs, 12)
# S/MIME Capabilities Attribute smimeCapabilities = univ.ObjectIdentifier('1.2.840.113549.1.9.15') smimeCapabilityMap = {} class SMIMECapability(univ.Sequence): pass SMIMECapability.componentType = namedtype.NamedTypes( namedtype.NamedType('capabilityID', univ.ObjectIdentifier()), namedtype.OptionalNamedType('parameters', univ.Any(), openType=opentype.OpenType( 'capabilityID', smimeCapabilityMap))) class SMIMECapabilities(univ.SequenceOf): pass SMIMECapabilities.componentType = SMIMECapability() class SMIMECapabilitiesParametersForRC2CBC(univ.Integer): # which carries the RC2 Key Length (number of bits) pass # S/MIME Encryption Key Preference Attribute