code: func NewCA(baseDir, org, name, country, province, locality, orgUnit, streetAddress, postalCode string) (*CA, error) {
  
  	var response error
  	var ca *CA
  
  	err := os.MkdirAll(baseDir, 0755)
  	if err == nil {
  		priv, signer, err := csp.GeneratePrivateKey(baseDir)
  		response = err
  		if err == nil {
  			// get public signing certificate
  			ecPubKey, err := csp.GetECPublicKey(priv)
  			response = err
  			if err == nil {
  				template := x509Template()
  				//this is a CA
  				template.IsCA = true
  				template.KeyUsage |= x509.KeyUsageDigitalSignature |
  					x509.KeyUsageKeyEncipherment | x509.KeyUsageCertSign |
  					x509.KeyUsageCRLSign
  				template.ExtKeyUsage = []x509.ExtKeyUsage{
  					x509.ExtKeyUsageClientAuth,
  					x509.ExtKeyUsageServerAuth,
  				}
  
  				//set the organization for the subject
  				subject := subjectTemplateAdditional(country, province, locality, orgUnit, streetAddress, postalCode)
  				subject.Organization = []string{org}
  				subject.CommonName = name
  
  				template.Subject = subject
  				template.SubjectKeyId = priv.SKI()
  
  				x509Cert, err := genCertificateECDSA(baseDir, name, &template, &template,
  					ecPubKey, signer)
  				response = err
  				if err == nil {
  					ca = &CA{
  						Name:               name,
  						Signer:             signer,
  						SignCert:           x509Cert,
  						Country:            country,
  						Province:           province,
  						Locality:           locality,
  						OrganizationalUnit: orgUnit,
  						StreetAddress:      streetAddress,
  						PostalCode:         postalCode,
  					}
  				}
  			}
  		}
  	}
  	return ca, response
  }
docs: // NewCA creates an instance of CA and saves the signing key pair in
  // baseDir/name