Ejemplo n.º 1
0
        public VaultManager(string vaultFolderPath, string vaultFilename)
        {
            this.vaultFolderPath = vaultFolderPath;
            this.vaultFilename   = vaultFilename;

            this.ActionLogs = new List <ActionLogItem>();

            powershellManager = new PowershellManager(vaultFolderPath, this.ActionLogs);
#if DEBUG
            this.InitVault(staging: true);
#else
            this.InitVault(staging: false);
#endif
            ReloadVaultConfig();

            /*
             * if (System.IO.Directory.Exists(vaultFolderPath))
             * {
             *  this.ReloadVaultConfig();
             *  powershellManager = new PowershellManager(vaultFolderPath, this.ActionLogs);
             * }
             * else
             * {
             * }*/
        }
Ejemplo n.º 2
0
        private void MainForm_Load(object sender, EventArgs e)
        {
            PowershellManager manager = new PowershellManager(null, null);

            if (!manager.IsValidVersion())
            {
                if (MessageBox.Show("The version of Powershell installed is not high enough, please install Powershell Version 3 or higher.", "Powershell Version Too Low", MessageBoxButtons.OK, MessageBoxIcon.Error) == DialogResult.OK)
                {
                    Application.Exit();
                }
            }
        }
Ejemplo n.º 3
0
        private void MainForm_Shown(object sender, EventArgs e)
        {
            InitAI();
            TrackPageView(nameof(MainForm));

            var powershellVersion = PowershellManager.GetPowershellVersion();

            if (powershellVersion < 4)
            {
                MessageBox.Show("This application requires PowerShell version 4.0 or higher. You can update it using the latest Windows Management Framework download from Microsoft.", Properties.Resources.AppName);

                Application.Exit();
                return;
            }

            this.VaultManager = new VaultManager(Properties.Settings.Default.VaultPath, LocalDiskVault.VAULT);

            PowershellManager manager = this.VaultManager.PowershellManager;

            /*if (!manager.IsAcmeSharpModuleInstalled())
             * {
             *  if (MessageBox.Show("The required PowerShell module 'ACMESharp' cannot be found. Please see https://www.powershellgallery.com/packages/ACMESharp/ or install from PowerShell command line as an administrator using: 'Install-Module -Name ACMESharp'",
             *          "ACMESharp Missing", MessageBoxButtons.OK, MessageBoxIcon.Error) == DialogResult.OK)
             *  {
             *      // Application.Exit();
             *  }
             * }*/

            if (Properties.Settings.Default.ShowBetaWarning)
            {
                this.lblGettingStarted.Text += "\r\n\r\n" + Properties.Resources.BetaWarning;
            }

            var vaultInfo = VaultManager.GetVaultConfig();

            if (vaultInfo != null && vaultInfo.Registrations == null)
            {
                //got an existing vault. If no contact registrations setup, prompt to add one
                var promptResult = MessageBox.Show("No certificate contact registrations have been setup. Would you like to add a new contact now? ", "Create New Contact?", MessageBoxButtons.YesNo);

                if (promptResult == DialogResult.Yes)
                {
                    ShowContactRegistrationDialog();
                }
            }
            ReloadVault();
        }
Ejemplo n.º 4
0
        public VaultManager(string vaultFolderPath, string vaultFilename)
        {
            this.vaultFolderPath = vaultFolderPath;
            this.vaultFilename   = vaultFilename;

            this.ActionLogs = new List <ActionLogItem>();

            powershellManager = new PowershellManager(vaultFolderPath, this.ActionLogs);
#if DEBUG
            this.InitVault(staging: true);
#else
            this.InitVault(staging: false);
#endif
            ReloadVaultConfig();

            //register default PKI provider
            //ACMESharp.PKI.CertificateProvider.RegisterProvider<ACMESharp.PKI.Providers.OpenSslLibProvider>();
            ACMESharp.PKI.CertificateProvider.RegisterProvider <ACMESharp.PKI.Providers.BouncyCastleProvider>();
        }
Ejemplo n.º 5
0
        private void MainForm_Load(object sender, EventArgs e)
        {
            PowershellManager manager = new PowershellManager(null, null);

            if (!manager.IsValidVersion())
            {
                if (MessageBox.Show("The version of Powershell installed is not high enough, please install Powershell Version 3 or higher.", "Powershell Version Too Low", MessageBoxButtons.OK, MessageBoxIcon.Error) == DialogResult.OK)
                {
                    Application.Exit();
                }
            }

            if (!manager.IsAcmeSharpModuleInstalled())
            {
                if (MessageBox.Show("The required PowerShell module 'ACMESharp' cannot be found.",
                                    "ACMESharp Missing", MessageBoxButtons.OK, MessageBoxIcon.Error) == DialogResult.OK)
                {
                    Application.Exit();
                }
            }
        }
Ejemplo n.º 6
0
        private void MainForm_Shown(object sender, EventArgs e)
        {
            InitAI();
            TrackPageView(nameof(MainForm));

            if (this.requirePowershell)
            {
                var powershellVersion = PowershellManager.GetPowershellVersion();
                if (powershellVersion < 4)
                {
                    MessageBox.Show("This application requires PowerShell version 4.0 or higher. You can update it using the latest Windows Management Framework download from Microsoft.", Properties.Resources.AppName);

                    Application.Exit();
                    return;
                }
            }

            this.VaultManager = new VaultManager(Properties.Settings.Default.VaultPath, LocalDiskVault.VAULT);

            if (Properties.Settings.Default.ShowBetaWarning)
            {
                // this.lblGettingStarted.Text += "\r\n\r\n" + Properties.Resources.BetaWarning;
            }

            var vaultInfo = VaultManager.GetVaultConfig();

            if (vaultInfo != null && vaultInfo.Registrations == null)
            {
                //got an existing vault. If no contact registrations setup, prompt to add one
                var promptResult = MessageBox.Show("No certificate contact registrations have been setup. Would you like to add a new contact now? ", "Create New Contact?", MessageBoxButtons.YesNo);

                if (promptResult == DialogResult.Yes)
                {
                    ShowContactRegistrationDialog();
                }
            }
            ReloadVault();
        }