示例#1
0
 private static int RunAddAndReturnExitCode(AddOptions opts)
 {
     try
     {
         CertStoreManager certStoreManager = new CertStoreManager(opts.StoreLocation, opts.StoreName);
         certStoreManager.AddCertificate(opts.Path, opts.Base64, opts.Password, opts.Thumbprint);
     }
     catch (Exception ex)
     {
         Console.WriteLine($"Opps, we had an Error: {ex.Message}");
         return(-1);
     }
     return(0);
 }
示例#2
0
        private static int RunReadAndReturnExitCode(ReadOptions opts)
        {
            try
            {
                CertStoreManager certStoreManager = new CertStoreManager(opts.StoreLocation, opts.StoreName);
                certStoreManager.ReadCertStore();
            }
            catch (Exception ex)
            {
                Console.WriteLine($"Opps, we had an Error: {ex.Message}");
                return(-1);
            }

            return(0);
        }
示例#3
0
        private static int RunListAndReturnExitCode(ListOptions opts)
        {
            try
            {
                CertStoreManager certStoreManager = new CertStoreManager();
                certStoreManager.ListStoreDetails();
            }
            catch (Exception ex)
            {
                Console.WriteLine($"Opps, we had an Error: {ex.Message}");
                return(-1);
            }

            return(0);
        }