As above, I think the pyOpenSSL library code can be responsible for parsing this string and can then pass a list of bytes to the application callback.