pyndn.encoding.der package¶
Submodules¶
pyndn.encoding.der.der module¶
This module defines the Der object with known DER node types.
-
class
pyndn.encoding.der.der.Der[source]¶ Bases:
object-
BitString= 3¶
-
BmpString= 30¶
-
Boolean= 1¶
-
CharacterString= 29¶
-
EmbeddedPdv= 43¶
-
Enumerated= 10¶
-
Eoc= 0¶
-
External= 40¶
-
GeneralString= 27¶
-
GeneralizedTime= 24¶
-
GraphicString= 25¶
-
Ia5String= 22¶
-
Integer= 2¶
-
Null= 5¶
-
NumericString= 18¶
-
ObjectDescriptor= 7¶
-
ObjectIdentifier= 6¶
-
OctetString= 4¶
-
PrintableString= 19¶
-
Real= 9¶
-
RelativeOid= 13¶
-
Sequence= 48¶
-
Set= 49¶
-
T61String= 20¶
-
UniversalString= 28¶
-
UtcTime= 23¶
-
Utf8String= 12¶
-
VideoTexString= 21¶
-
VisibleString= 26¶
-
pyndn.encoding.der.der_exceptions module¶
Exceptions that may occur during DER encoding/decoding Correspond to exceptions in ndn-cpp
pyndn.encoding.der.der_node module¶
-
class
pyndn.encoding.der.der_node.DerGeneralizedTime(msSince1970=None)[source]¶
-
class
pyndn.encoding.der.der_node.DerNode(nodeType)[source]¶ Bases:
object-
decode(inputBuf, startIdx=0)[source]¶ Decode and store the data from an input buffer. :param inputBuf: The input buffer to read from. :type inputBuf: bytearray or Blob :param startIdx: (optional) An offset into the buffer. :type startIdx: int
-
getChildren()[source]¶ If this object is a DerSequence, get the children of this node. Otherwise, raise an exception. (DerSequence overrides to implement this method.) :return: The children of this node :rtype: array of DerNode :raises: DerDecodingException if this object is not a DerSequence.
-
static
getSequence(children, index)[source]¶ Check that index is in bounds for the children list, and return children[index].
Parameters: - children (array of DerNode) – The list of DerNode, usually returned by another call to getChildren.
- index (int) – The index of the children.
Returns: children[index] which is a DerSequence
Return type: Raises: DerDecodingException if index is out of bounds or if children[index] is not a DerSequence.
-
getSize()[source]¶ Get the total length of the encoding. :return: The total (header + payload) length :rtype: int
-
-
class
pyndn.encoding.der.der_node.DerStructure(nodeType)[source]¶ Bases:
pyndn.encoding.der.der_node.DerNode-
addChild(node, notifyParent=False)[source]¶ Add a child to this node. :param node: The child node to add. :type node: DerNode :param notifyParent: (optional) Set to true to cause any containing nodes to update their size :type notifyParent: boolean
-
decode(inputBuf, startIdx=0)[source]¶ Decode and store the data from an input buffer. Recursively populates child nodes. :param inputBuf: The input buffer to read from. :type inputBuf: bytearray or Blob :param startIdx: (optional) An offset into the buffer. :type startIdx: int
-