Example #1
0
        public CANode(CA ca)
        {
            this.ca        = ca;
            this.caControl = ca.CaControl;
            this.Tag       = caControl; // Make this available for child use

            // Add in the folders for the CA database (keeping track of the CertsNode instances)
            currentCerts = new CertsNode(caControl, CertStatus.Current)
            {
                DisplayName = "Current Certificates"
            };
            expiredCerts = new CertsNode(caControl, CertStatus.Expired)
            {
                DisplayName = "Expired Certificates"
            };
            revokedCerts = new CertsNode(caControl, CertStatus.Revoked)
            {
                DisplayName = "Revoked Certificates"
            };
            profiles = new ProfilesNode(caControl)
            {
                DisplayName = "Profiles"
            };

            this.Children.Add(currentCerts);
            this.Children.Add(revokedCerts);
            this.Children.Add(expiredCerts);
            this.Children.Add(profiles);

            // Check the status of the CA and setup accordngly
            Refresh();
        }
Example #2
0
        internal CertsNode(CaControl info, CertStatus certStatus)
        {
            caInfo = info;
            status = certStatus;

            this.ImageIndex         = 3;
            this.SelectedImageIndex = 3;

            // Create the CaInfoContext instance for use by the ListView
            CaInfoContext context = new CaInfoContext(info)
            {
                certStatus = status
            };

            // Create a ListView for the node.
            MmcListViewDescription lvd = new MmcListViewDescription();

            lvd.DisplayName = caInfo.CAName;
            lvd.ViewType    = typeof(CertListView);
            lvd.Options     = MmcListViewOptions.ExcludeScopeNodes | MmcListViewOptions.SingleSelect;
            lvd.Tag         = context;

            this.ViewDescriptions.Add(lvd);
            this.ViewDescriptions.DefaultIndex = 0;

            Refresh();
        }
Example #3
0
        public IssCert(CaControl info)
        {
            caInfo = info;
            config = Configuration.Instance;
            InitializeComponent();
            lbValidUnits.SelectedText = "Years";

            // Populate the list of profiles in the selectBox
            lbProfiles.Items.Add("none");
            foreach (ProfileDb profile in caInfo.Profiles)
            {
                lbProfiles.Items.Add(profile.profile.Name);
            }
        }
Example #4
0
        /// <summary>
        /// Loads the ListView with data
        /// </summary>
        public void Refresh()
        {
            // Clear existing information
            this.ResultNodes.Clear();

            caInfo = (CaControl)this.ViewDescriptionTag;

            foreach (ProfileDb profile in caInfo.Profiles)
            {
                ResultNode node = new ResultNode();

                node.ImageIndex  = 6;
                node.DisplayName = profile.profile.Name;
                node.SubItemDisplayNames.Add(profile.profile.Version);
                node.SubItemDisplayNames.Add(profile.profile.Description);
                node.SubItemDisplayNames.Add(profile.profile.CertificateLifetime.Period.ToString() + " " + profile.profile.CertificateLifetime.Units.ToString());
                node.Tag = profile;

                this.ResultNodes.Add(node);
            }
        }
Example #5
0
        internal RekeyCert(CaControl caInfo, X509Certificate origCert)
        {
            this.caInfo   = caInfo;
            this.origCert = origCert;
            config        = Configuration.Instance;
            InitializeComponent();
            lblStatusString.Visible = false;
            ckbProfile.Enabled      = false;
            ckbProfile.Checked      = false;
            lbProfiles.Enabled      = false;
            ckbProfile.Enabled      = false;
            ckbOverride.Checked     = false;
            tbNotBefore.Enabled     = false;
            tbNotAfter.Enabled      = false;
            butSubmit.Enabled       = false;

            // Populate the list of profiles in the selectBox
            lbProfiles.Items.Add("none");
            foreach (ProfileDb profile in caInfo.Profiles)
            {
                lbProfiles.Items.Add(profile.profile.Name);
            }

            // Check to see if the orig cert used a profile
            List <DataBase> certDb      = caInfo.GetCerts(CertStatus.Current);
            DataBase        certDbEntry = certDb.Find(c => c.serialNumber == origCert.SerialNumber.ToString());

            if (certDbEntry.profile != "")
            {
                ckbProfile.Checked      = true;
                lbProfiles.SelectedItem = certDbEntry.profile;
                // need to make sure the index is updated?
            }
            else
            {
                lbProfiles.SelectedItem = "none";
            }
        }
Example #6
0
        public ProfilesNode(CaControl info)
        {
            caInfo                    = info;
            this.ImageIndex           = 6;
            this.SelectedImageIndex   = 6;
            this.EnabledStandardVerbs = StandardVerbs.Refresh;

            // Create a list view for the node.
            this.ViewDescriptions.Clear();
            lvd = null;

            // Create a list view for the node.
            lvd             = new MmcListViewDescription();
            lvd.DisplayName = caInfo.CAName;
            lvd.ViewType    = typeof(ProfilesListView);
            lvd.Options     = MmcListViewOptions.ExcludeScopeNodes | MmcListViewOptions.SingleSelect;
            lvd.Tag         = caInfo;


            // Attach the view to the node
            this.ViewDescriptions.Add(lvd);
            this.ViewDescriptions.DefaultIndex = 0;
        }
Example #7
0
 public CertSave(CaControl caInfo)
 {
     this.caInfo = caInfo;
     config      = Configuration.Instance;
     InitializeComponent();
 }
Example #8
0
 internal CaInfoContext(CaControl info)
 {
     this.caInfo = info;
 }