예제 #1
0
        /// <summary>
        /// Get the CsrPlugin which is used to generate the private key
        /// and request the certificate
        /// </summary>
        /// <returns></returns>
        public virtual ICsrPluginOptionsFactory GetCsrPlugin(ILifetimeScope scope)
        {
            var pluginName = _options.MainArguments.Csr;

            if (string.IsNullOrEmpty(pluginName))
            {
                return(scope.Resolve <RsaOptionsFactory>());
            }
            var ret = _plugins.CsrPluginFactory(scope, pluginName);

            if (ret == null)
            {
                _log.Error("Unable to find csr plugin {PluginName}", pluginName);
                return(new NullCsrFactory());
            }
            return(ret);
        }