MCPcopy Create free account
hub / github.com/PierreGode/Ragnar / _componentSortKey

Method _componentSortKey

pager_lib/pyasn1/codec/cer/encoder.py:146–162  ·  view source on GitHub ↗

Sort SET components by tag Sort regardless of the Choice value (static sort)

(componentAndType)

Source from the content-addressed store, hash-verified

144class SetEncoder(encoder.SequenceEncoder):
145 @staticmethod
146 def _componentSortKey(componentAndType):
147 """Sort SET components by tag
148
149 Sort regardless of the Choice value (static sort)
150 """
151 component, asn1Spec = componentAndType
152
153 if asn1Spec is None:
154 asn1Spec = component
155
156 if asn1Spec.typeId == univ.Choice.typeId and not asn1Spec.tagSet:
157 if asn1Spec.tagSet:
158 return asn1Spec.tagSet
159 else:
160 return asn1Spec.componentType.minTagSet
161 else:
162 return asn1Spec.tagSet
163
164 def encodeValue(self, value, asn1Spec, encodeFun, **options):
165

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected