// GenerateRootCertCSR returns a CA root cert x509 Certificate
GenerateRootCertCSR returns a CA root cert x509 Certificate
// GenerateRootCertCSR returns a CA root cert x509 Certificate
func GenerateRootCertCSR(org, cn string, publicKey interface{}, ttl time.Duration) (*x509.Certificate, error) {
	cert, err := generateBaseCert(ttl, publicKey)
	if err != nil {
		return nil, err
	}
	cert.KeyUsage = x509.KeyUsageCertSign
	cert.ExtKeyUsage = append(cert.ExtKeyUsage, x509.ExtKeyUsageServerAuth, x509.ExtKeyUsageClientAuth)
	cert.Subject = pkix.Name{
		CommonName:   cn,
		Organization: []string{org},
	}
	cert.IsCA = true
	cert.BasicConstraintsValid = true
	cert.SignatureAlgorithm = x509.ECDSAWithSHA256
	return cert, nil
}
func GenerateRootCertCSR ( org , cn string , publicKey interface { } , ttl time . Duration ) ( * x509 . Certificate , error ) { cert , err := generateBaseCert ( ttl , publicKey ) if err != nil { return nil , err } cert . KeyUsage = x509 . KeyUsageCertSign cert . ExtKeyUsage = append ( cert . ExtKeyUsage , x509 . ExtKeyUsageServerAuth , x509 . ExtKeyUsageClientAuth ) cert . Subject = pkix . Name { CommonName : cn , Organization : [ ] string { org } , } cert . IsCA = true cert . BasicConstraintsValid = true cert . SignatureAlgorithm = x509 . ECDSAWithSHA256 return cert , nil }
GenerateRootCertCSR returns a CA root cert x509 Certificate
GenerateRootCertCSR returns a CA root cert x509 Certificate