You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: server.go
    path of file: ./repos/openyurt/pkg/yurthub/certificate/server
    
    the code of the file until where you have to start completion: /*
Copyright 2023 The OpenYurt Authors.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License i
    
func NewHubServerCertificateManager(client clientset.Interface, clientCertManager hubCert.YurtClientCertificateManager, nodeName, pkiDir string, certIPs []net.IP) (hubCert.YurtServerCertificateManager, error) {
	hubServerCertStore, err := store.NewFileStoreWrapper(fmt.Sprintf("%s-server", projectinfo.GetHubName()), pkiDir, pkiDir, "", "")
	if err != nil {
		return nil, errors.Wrap(err, "couldn't new hub server cert store")
	}

	kubeClientFn := func(current *tls.Certificate) (clientset.Interface, error) {
		// waiting for the certificate is generated
		_ = wait.PollInfinite(5*time.Second, func() (bool, error) {
			// keep polling until the yurthub client certificate is signed
			if clientCertManager.GetAPIServerClientCert() != nil {
				return true, nil
			}
			klog.Infof("waiting for the controller-manager to sign the %s client certificate", projectinfo.GetHubName())
			return false, nil
		})

		if !yurtutil.IsNil(client) {
			return client, nil
		}

		return kubeconfigutil.ClientSetFromFile(clientCertManager.GetHubConfFile())
	}

	hubServerCertManager, sErr := certfactory.NewCertManagerFactoryWithFnAndStore(kubeClientFn, hubServerCertStore).New(&certfactory.CertManagerConfig{
		ComponentName:  fmt.Sprintf("%s-server", projectinfo.GetHubName()),
		SignerName:     certificatesv1.KubeletServingSignerName,
		ForServerUsage: true,
		CommonName:     fmt.Sprintf("system:node:%s", nodeName),
		Organizations:  []string{user.NodesGroup},
		IPs:            certIPs,
	})
	if sErr != nil {
		return nil, sErr
	}

	return &hubServerCertificateManager{
		hubServerCertManager: hubServerCertManager,
		hubServerCertStore:   hubServerCertStore,
	}, nil
}