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

Class NullPayloadDecoder

pager_lib/pyasn1/codec/ber/decoder.py:382–402  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

380
381
382class NullPayloadDecoder(AbstractSimplePayloadDecoder):
383 protoComponent = univ.Null('')
384
385 def valueDecoder(self, substrate, asn1Spec,
386 tagSet=None, length=None, state=None,
387 decodeFun=None, substrateFun=None,
388 **options):
389
390 if tagSet[0].tagFormat != tag.tagFormatSimple:
391 raise error.PyAsn1Error('Simple tag format expected')
392
393 for chunk in readFromStream(substrate, length, options):
394 if isinstance(chunk, SubstrateUnderrunError):
395 yield chunk
396
397 component = self._createComponent(asn1Spec, tagSet, '', **options)
398
399 if chunk:
400 raise error.PyAsn1Error('Unexpected %d-octet substrate for Null' % length)
401
402 yield component
403
404
405class ObjectIdentifierPayloadDecoder(AbstractSimplePayloadDecoder):

Callers 1

decoder.pyFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected