code: func Template(appName, commonName string) (*x509.Certificate, error) {
  	// generate a random serial number (a real cert authority would have some logic behind this)
  	serialNumberLimit := new(big.Int).Lsh(big.NewInt(1), 128)
  	serialNumber, err := rand.Int(rand.Reader, serialNumberLimit)
  	if err != nil {
  		return nil, errors.New("failed to generate serial number: " + err.Error())
  	}
  
  	tmpl := x509.Certificate{
  		IsCA:         true,
  		SerialNumber: serialNumber,
  		Subject: pkix.Name{
  			Organization: []string{appName},
  			CommonName:   commonName,
  		},
  
  		SignatureAlgorithm:    x509.SHA256WithRSA,
  		NotBefore:             time.Now(),
  		NotAfter:              time.Now().Add(time.Hour * 24 * 365 * 4), // valid for 4 years
  		BasicConstraintsValid: true,
  	}
  
  	return &tmpl, nil
  }
docs: // Template is a helper function to create a cert template with a
  // serial number and other required fields