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: manager.go
    path of file: ./repos/openyurt/pkg/yurthub/certificate/manager
    
    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 is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/

package manager

import (
	"errors"
	"net"
	"net/url"
	"path/filepath"

	utilerrors "k8s.io/apimachinery/pkg/util/errors"
	"k8s.io/klog/v2"

	"github.com/openyurtio/openyurt/cmd/yurthub/app/options"
	"github.com/openyurtio/openyurt/pkg/projectinfo"
	ipUtils "github.com/openyurtio/openyurt/pkg/util/ip"
	hubCert "github.com/op
    
func NewYurtHubCertManager(options *options.YurtHubOptions, remoteServers []*url.URL) (hubCert.YurtCertificateManager, error) {
	var clientCertManager hubCert.YurtClientCertificateManager
	var err error
	var workDir string

	if len(options.RootDir) == 0 {
		workDir = DefaultWorkDir
	} else {
		workDir = options.RootDir
	}

	if options.BootstrapMode == "kubeletcertificate" {
		clientCertManager, err = kubeletcertificate.NewKubeletCertManager(KubeConfFile, KubeletCAFile, KubeletPemFile)
		if err != nil {
			return nil, err
		}
	} else {
		cfg := &token.ClientCertificateManagerConfiguration{
			WorkDir:                  workDir,
			NodeName:                 options.NodeName,
			JoinToken:                options.JoinToken,
			BootstrapFile:            options.BootstrapFile,
			CaCertHashes:             options.CACertHashes,
			YurtHubCertOrganizations: options.YurtHubCertOrganizations,
			RemoteServers:            remoteServers,
			Client:                   options.ClientForTest,
		}
		clientCertManager, err = token.NewYurtHubClientCertManager(cfg)
		if err != nil {
			return nil, err
		}
	}

	// use dummy ip and bind ip as cert IP SANs
	certIPs := ipUtils.RemoveDupIPs([]net.IP{
		net.ParseIP(options.HubAgentDummyIfIP),
		net.ParseIP(options.YurtHubHost),
		net.ParseIP(options.YurtHubProxyHost),
	})
	serverCertManager, err := hubServerCert.NewHubServerCertificateManager(options.ClientForTest, clientCertManager, options.NodeName, filepath.Join(workDir, "pki"), certIPs)
	if err != nil {
		return nil, err
	}

	hubCertManager := &yurtHubCertManager{
		YurtClientCertificateManager: clientCertManager,
		YurtServerCertificateManager: serverCertManager,
	}

	return hubCertManager, nil
}