write_cert function

Generate Self-Signed Certificate and Key