Пример #1
0
        private static async Task <int> Run(ExtractCertVerb arg)
        {
            var console = new ConsoleImpl(Console.Out, Console.Error);

            var signingManager = new SigningManager();
            var executor       = new ExtractCertVerbExecutor(arg, signingManager, console);
            var exitCode       = await executor.Execute().ConfigureAwait(false);

            Environment.ExitCode = exitCode;
            return(exitCode);
        }
Пример #2
0
        protected override string GenerateSilentCommandLine()
        {
            switch (this.OperationType.CurrentValue)
            {
            case CertOperationType.Extract:
            {
                var verb = new ExtractCertVerb
                {
                    Output = this.ExtractCertificate.CurrentValue,
                    File   = this.InputPath.CurrentValue
                };

                if (string.IsNullOrEmpty(verb.Output))
                {
                    verb.Output = "<output-path>";
                }

                if (string.IsNullOrEmpty(verb.File))
                {
                    verb.File = "<input-path>";
                }

                return(verb.ToCommandLineString());
            }

            case CertOperationType.Import:
            {
                var verb = new TrustVerb()
                {
                    File = this.InputPath.CurrentValue
                };

                if (string.IsNullOrEmpty(verb.File))
                {
                    verb.File = "<input-path>";
                }

                return(verb.ToCommandLineString());
            }

            default:
            {
                throw new NotSupportedException();
            }
            }
        }