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

Class Null

pager_lib/pyasn1/type/univ.py:971–1020  ·  view source on GitHub ↗

Create |ASN.1| schema or value object. |ASN.1| class is based on :class:`~pyasn1.type.base.SimpleAsn1Type`, its objects are immutable and duck-type Python :class:`str` objects (always empty). Keyword Args ------------ value: :class:`str` or |ASN.1| object Python emp

Source from the content-addressed store, hash-verified

969
970
971class Null(OctetString):
972 """Create |ASN.1| schema or value object.
973
974 |ASN.1| class is based on :class:`~pyasn1.type.base.SimpleAsn1Type`, its
975 objects are immutable and duck-type Python :class:`str` objects
976 (always empty).
977
978 Keyword Args
979 ------------
980 value: :class:`str` or |ASN.1| object
981 Python empty :class:`str` literal or any object that evaluates to :obj:`False`
982 If `value` is not given, schema object will be created.
983
984 tagSet: :py:class:`~pyasn1.type.tag.TagSet`
985 Object representing non-default ASN.1 tag(s)
986
987 Raises
988 ------
989 ~pyasn1.error.ValueConstraintError, ~pyasn1.error.PyAsn1Error
990 On constraint violation or bad initializer.
991
992 Examples
993 --------
994 .. code-block:: python
995
996 class Ack(Null):
997 '''
998 ASN.1 specification:
999
1000 Ack ::= NULL
1001 '''
1002 ack = Ack('')
1003 """
1004
1005 #: Set (on class, not on instance) or return a
1006 #: :py:class:`~pyasn1.type.tag.TagSet` object representing ASN.1 tag(s)
1007 #: associated with |ASN.1| type.
1008 tagSet = tag.initTagSet(
1009 tag.Tag(tag.tagClassUniversal, tag.tagFormatSimple, 0x05)
1010 )
1011 subtypeSpec = OctetString.subtypeSpec + constraint.SingleValueConstraint(b'')
1012
1013 # Optimization for faster codec lookup
1014 typeId = OctetString.getTypeId()
1015
1016 def prettyIn(self, value):
1017 if value:
1018 return value
1019
1020 return b''
1021
1022
1023class ObjectIdentifier(base.SimpleAsn1Type):

Callers

nothing calls this directly

Calls 1

getTypeIdMethod · 0.80

Tested by

no test coverage detected