def save_to_file(self, path): with open(path, "w") as f: f.write(self.cert_pem()) f.write(self.key_pem())