x509 function for creating signed certs