func GenTLSAssets(jsonConfig string) error {
	// Read the Json config file and unmarshall content into struct type X509Config
	x509Config, err := config.NewX509Config(jsonConfig)
	if err != nil {
		return err
	}

	if setup.NewDirectoryHandler(setup.LoggingClient) == nil {
		return errors.New("setup.LoggingClient is nil")
	}

	seed, err := setup.NewCertificateSeed(x509Config, setup.NewDirectoryHandler(setup.LoggingClient))
	if err != nil {
		return err
	}

	rootCA, err := certificates.NewCertificateGenerator(certificates.RootCertificate, seed, certificates.NewFileWriter(), setup.LoggingClient)
	if err != nil {
		return err
	}

	err = rootCA.Generate()
	if err != nil {
		return err
	}

	tlsCert, err := certificates.NewCertificateGenerator(certificates.TLSCertificate, seed, certificates.NewFileWriter(), setup.LoggingClient)
	if err != nil {
		return err
	}

	tlsCert.Generate()
	if err != nil {
		return err
	}

	return nil
}
// GenTLSAssets generates the TLS assets based on the JSON configuration file
GenTLSAssets generates the TLS assets based on the JSON configuration file
// GenTLSAssets generates the TLS assets based on the JSON configuration file
func GenTLSAssets(jsonConfig string) error {
	x509Config, err := config.NewX509Config(jsonConfig)
	if err != nil {
		return err
	}
	if setup.NewDirectoryHandler(setup.LoggingClient) == nil {
		return errors.New("setup.LoggingClient is nil")
	}
	seed, err := setup.NewCertificateSeed(x509Config, setup.NewDirectoryHandler(setup.LoggingClient))
	if err != nil {
		return err
	}
	rootCA, err := certificates.NewCertificateGenerator(certificates.RootCertificate, seed, certificates.NewFileWriter(), setup.LoggingClient)
	if err != nil {
		return err
	}
	err = rootCA.Generate()
	if err != nil {
		return err
	}
	tlsCert, err := certificates.NewCertificateGenerator(certificates.TLSCertificate, seed, certificates.NewFileWriter(), setup.LoggingClient)
	if err != nil {
		return err
	}
	tlsCert.Generate()
	if err != nil {
		return err
	}
	return nil
}
func GenTLSAssets ( jsonConfig string ) error { x509Config , err := config . NewX509Config ( jsonConfig ) if err != nil { return err } if setup . NewDirectoryHandler ( setup . LoggingClient ) == nil { return errors . New ( " " ) } seed , err := setup . NewCertificateSeed ( x509Config , setup . NewDirectoryHandler ( setup . LoggingClient ) ) if err != nil { return err } rootCA , err := certificates . NewCertificateGenerator ( certificates . RootCertificate , seed , certificates . NewFileWriter ( ) , setup . LoggingClient ) if err != nil { return err } err = rootCA . Generate ( ) if err != nil { return err } tlsCert , err := certificates . NewCertificateGenerator ( certificates . TLSCertificate , seed , certificates . NewFileWriter ( ) , setup . LoggingClient ) if err != nil { return err } tlsCert . Generate ( ) if err != nil { return err } return nil }
GenTLSAssets generates the TLS assets based on the JSON configuration file
GenTLSAssets generates the TLS assets based on the JSON configuration file
// Read the Json config file and unmarshall content into struct type X509Config