Creating x509.log from Parsed x509 Bytestring

Hey Community,

I have a x509 Certificate from a Byte-string in a local variable. I want to save it as a file and create the corresponding entry in the x509.log. How do I accomplish that?

Something like:
local cert: string = hexstr_to_bytestring(“XXXXXXXXXXXX”);

Thanks in advance.

Your zeek noob