func GenCertAndKey(domain string, outCertFilepath string, outKeyFilepath string, expiresInDays int) error {
	numBits := 2048
	country := "US"
	state := "New York"
	local := "Brooklyn"
	org := "Example Company"

	if _, err := exec.Command("openssl", "req", "-newkey", fmt.Sprintf("rsa:%d", numBits), "-sha256", "-nodes", "-keyout", outKeyFilepath, "-x509", "-days", strconv.Itoa(expiresInDays), "-out", outCertFilepath, "-subj", fmt.Sprintf("/C=%s/ST=%s/L=%s/O=%s/CN=%s", country, state, local, org, domain)).Output(); err != nil {
		return err
	}

	return nil
}
// GenCertAndKey generates a certificate and a private key file with given domain.
// (`OpenSSL` is needed.)
GenCertAndKey generates a certificate and a private key file with given domain.
(`OpenSSL` is needed.)
// GenCertAndKey generates a certificate and a private key file with given domain . // ( ` OpenSSL ` is needed . )
func GenCertAndKey(domain string, outCertFilepath string, outKeyFilepath string, expiresInDays int) error {
	numBits := 2048
	country := "US"
	state := "New York"
	local := "Brooklyn"
	org := "Example Company"
	if _, err := exec.Command("openssl", "req", "-newkey", fmt.Sprintf("rsa:%d", numBits), "-sha256", "-nodes", "-keyout", outKeyFilepath, "-x509", "-days", strconv.Itoa(expiresInDays), "-out", outCertFilepath, "-subj", fmt.Sprintf("/C=%s/ST=%s/L=%s/O=%s/CN=%s", country, state, local, org, domain)).Output(); err != nil {
		return err
	}
	return nil
}
func GenCertAndKey ( domain string , outCertFilepath string , outKeyFilepath string , expiresInDays int ) error { numBits := 2048 country := " " state := " " local := " " org := " " if _ , err := exec . Command ( " " , " " , " " , fmt . Sprintf ( " " , numBits ) , " " , " " , " " , outKeyFilepath , " " , " " , strconv . Itoa ( expiresInDays ) , " " , outCertFilepath , " " , fmt . Sprintf ( " " , country , state , local , org , domain ) ) . Output ( ) ; err != nil { return err } return nil }
GenCertAndKey generates a certificate and a private key file with given domain.
GenCertAndKey generates a certificate and a private key file with given domain .