Run-time and Generated Python Encode Methods

Three types of Python encode functions/methods are available for encoding different types of data. These are:

The encode methods do not have a return value and will raise an exception if the encoding fails.

The encode methods on Asn1JsonEncodeBuffer have a value parameter for the value to be encoded, and in some cases additional parameters (e.g. encode_octetstring has a parameter for the base for the encoding, base). Of course, these methods are invoked on an instance of Asn1JsonEncodeBuffer.

The generated encode methods accept an Asn1JsonEncodeBuffer, the buffer to encode to. Static methods additionally accept the value to be encoded. Some examples:

  @staticmethod
  def json_encode(encbuf, value):
  
  
  def json_encode(self, encbuf):