code: func WriteCert(pkiPath, name string, cert *x509.Certificate) error {
  	if cert == nil {
  		return errors.New("certificate cannot be nil when writing to file")
  	}
  
  	certificatePath := pathForCert(pkiPath, name)
  	if err := certutil.WriteCert(certificatePath, EncodeCertPEM(cert)); err != nil {
  		return errors.Wrapf(err, "unable to write certificate to file %s", certificatePath)
  	}
  
  	return nil
  }
docs: // WriteCert stores the given certificate at the given location