nuropb.encodings.serializor

Module Contents

Functions

get_serializor

Returns a serializor object for the specified encoded payload type

encode_payload

param public_key:

param payload:

param payload_type:

“json”

param public_key:

rsa.PublicKey

return:

a json bytes string imputed encoded payload

decode_payload

param encoded_payload:

param payload_type:

“json”

return:

PayloadDict

Data

SerializorTypes

API

nuropb.encodings.serializor.SerializorTypes

None

nuropb.encodings.serializor.get_serializor(payload_type: str = 'json') nuropb.encodings.serializor.SerializorTypes

Returns a serializor object for the specified encoded payload type

Parameters:

payload_type – “json”

Returns:

a serializor object

nuropb.encodings.serializor.encode_payload(payload: nuropb.interface.PayloadDict, payload_type: str = 'json', public_key: cryptography.hazmat.primitives.asymmetric.rsa.RSAPublicKey = None) bytes
Parameters:
  • public_key

  • payload

  • payload_type – “json”

  • public_key – rsa.PublicKey

Returns:

a json bytes string imputed encoded payload

nuropb.encodings.serializor.decode_payload(encoded_payload: bytes, payload_type: str = 'json') nuropb.interface.PayloadDict
Parameters:
  • encoded_payload

  • payload_type – “json”

Returns:

PayloadDict