Ejemplo n.º 1
0
        private static async Task <int> Run(TrustVerb arg)
        {
            var console        = new ConsoleImpl(Console.Out, Console.Error);
            var signingManager = new SigningManager();
            var executor       = new TrustVerbExecutor(arg, signingManager, console);
            var exitCode       = await executor.Execute().ConfigureAwait(false);

            Environment.ExitCode = exitCode;
            return(exitCode);
        }
Ejemplo n.º 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();
            }
            }
        }