예제 #1
0
        public override ICsrPluginOptionsFactory GetCsrPlugin(ILifetimeScope scope)
        {
            if (string.IsNullOrEmpty(_options.MainArguments.Csr) &&
                _runLevel.HasFlag(RunLevel.Advanced))
            {
                _input.Show(null, "After ownership of the domain(s) has been proven, we will create" +
                            " a Certificate Signing Request (CSR) to obtain the actual certificate. " +
                            "The CSR determines properties of the certificate like which " +
                            "(type of) key to use. If you are not sure what to pick here, RSA is the safe default.",
                            true);

                var ret = _input.ChooseFromList(
                    "What kind of private key should be used for the certificate?",
                    _plugins.CsrPluginOptionsFactories(scope).
                    Where(x => !(x is INull)).
                    OrderBy(x => x.Order).
                    ThenBy(x => x.Description),
                    x => Choice.Create(x, description: x.Description, @default: x is RsaOptionsFactory));
                return(ret);
            }
            else
            {
                return(base.GetCsrPlugin(scope));
            }
        }
예제 #2
0
 public override ICsrPluginOptionsFactory GetCsrPlugin(ILifetimeScope scope)
 {
     if (string.IsNullOrEmpty(_options.MainArguments.Csr) &&
         _runLevel.HasFlag(RunLevel.Advanced))
     {
         var ret = _input.ChooseFromList(
             "What kind of CSR would you like to create?",
             _plugins.CsrPluginOptionsFactories(scope).
             Where(x => !(x is INull)).
             OrderBy(x => x.Description),
             x => Choice.Create(x, description: x.Description, @default: x is RsaOptionsFactory));
         return(ret);
     }
     else
     {
         return(base.GetCsrPlugin(scope));
     }
 }