Esempio n. 1
0
 internal static RootCommand CreateCommand()
 {
     return(new RootCommand("Manages JSON Web Keys")
     {
         NewCommand.Create(),
         EncryptCommand.Create(),
         DecryptCommand.Create(),
         ConvertCommand.Create(),
         CheckCommand.Create()
     });
 }
Esempio n. 2
0
        private static async Task <int> Main(string[] args)
        {
            var rootCommand = new RootCommand("Manages JSON Web Keys")
            {
                NewCommand.Create(),
                EncryptCommand.Create(),
                DecryptCommand.Create(),
                ConvertCommand.Create(),
                CheckCommand.Create()
            };
            Parser parser = BuildParser(rootCommand);

            // Parse the incoming args so we can give warnings when deprecated options are used.
            _parseResult = parser.Parse(args);
            ConsoleExtensions.IsVerbose = _parseResult.HasOption("--verbose");

            return(await parser.InvokeAsync(args));
        }
Esempio n. 3
0
        internal static Command Create()
        {
            var command = new ConvertCommand()
            {
                new ConvertX509Command()
                .RequiredInputPath()
                .OptionalPrivateKeyOutputPath()
                .OptionalPublicKeyOutputPath()
                .OptionalCertificatePassword()
                .OptionalEncryptionPassword()
                .Force()
                .Verbose(),

                new ConvertPemCommand()
                .RequiredInputPath()
                .OptionalPrivateKeyOutputPath()
                .OptionalPublicKeyOutputPath()
                .OptionalEncryptionPassword()
                .Force()
                .Verbose()
            };

            return(command);
        }