logger.warn("None cert in certificate.save_to_string")
return ""
string = OpenSSL.crypto.dump_certificate(OpenSSL.crypto.FILETYPE_PEM, self.x509)
+ if isinstance(string, bytes):
+ string = string.decode()
if save_parents and self.parent:
string = string + self.parent.save_to_string(save_parents)
return string
f = filep
else:
f = open(filename, 'w')
+ if isinstance(string, bytes):
+ string = string.decode()
f.write(string)
f.close()
self.filename = filename
f = filep
else:
f = open(filename, "w")
+ if isinstance(self.xml, bytes):
+ self.xml = self.xml.decode()
f.write(self.xml)
f.close()
def save_to_string(self, save_parents=True):
if not self.xml:
self.encode()
+ if isinstance(self.xml, bytes):
+ self.xml = self.xml.decode()
return self.xml
def get_refid(self):