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: acra-keymaker.go
    path of file: ./repos/acra/cmd/acra-keymaker
    
    the code of the file until where you have to start completion: /*
Copyright 2016, Cossack Labs Limited

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 
    
func openKeyStoreV1(output, outputPublic string, extractor *args.ServiceExtractor) keystore.KeyMaking {
	var keyStoreEncryptor keystore.KeyEncryptor

	keyStoreEncryptor, err := keyloader.CreateKeyEncryptor(extractor, "")
	if err != nil {
		log.WithError(err).Errorln("Can't init keystore KeyEncryptor")
		os.Exit(1)
	}

	keyStoreBuilder := filesystem.NewCustomFilesystemKeyStore()
	if outputPublic != output {
		keyStoreBuilder.KeyDirectories(output, outputPublic)
	} else {
		keyStoreBuilder.KeyDirectory(output)
	}
	keyStoreBuilder.Encryptor(keyStoreEncryptor)

	if redis := cmd.ParseRedisCLIParameters(extractor); redis.KeysConfigured() {
		// if redisTLS = nil then will not be used TLS for Redis
		var redisTLS *tls.Config
		var err error
		if redis.TLSEnable {
			redisTLS, err = network.NewTLSConfigByName(extractor, "redis", redis.HostPort, network.ClientNameConstructorFunc())
			if err != nil {
				log.WithError(err).WithField(logging.FieldKeyEventCode, logging.EventCodeErrorCantInitKeyStore).
					Errorln("Can't initialize TLS config for Redis client")
				os.Exit(1)
			}
		}
		keyStorage, err := filesystem.NewRedisStorage(redis.HostPort, redis.Password, redis.DBKeys, redisTLS)
		if err != nil {
			log.WithError(err).WithField(logging.FieldKeyEventCode, logging.EventCodeErrorCantInitKeyStore).
				Errorln("Can't initialize Redis client")
			os.Exit(1)
		}
		keyStoreBuilder.Storage(keyStorage)
	}
	keyStore, err := keyStoreBuilder.Build()
	if err != nil {
		log.WithError(err).Errorln("Can't init keystore")
		os.Exit(1)
	}

	if keyLoaderParams := keyloader.ParseCLIOptions(extractor); keyLoaderParams.KeystoreEncryptorType == keyloader.KeystoreStrategyKMSPerClient {
		keyManager, _ := kms.NewKeyManager(kms.ParseCLIParameters(extractor))
		return base.NewKeyMakingWrapper(keyStore, keyManager, kms.NewKMSPerClientKeyMapper())
	}
	return keyStore
}