Beispiel #1
0
        private static void GetAllWorker()
        {
            all = new List <ADCertificateTemplate>();
            ADCertificateTemplate Template;

            using (DirectoryEntry TemplatesContainer = new DirectoryEntry(LdapUrls.CertificateTemplatesContainer))
            {
                foreach (DirectoryEntry TemplateEntry in TemplatesContainer.Children)
                {
                    try
                    {
                        Template = new ADCertificateTemplate(TemplateEntry);
                        all.Add(Template);
                    }
                    catch (CertificateTemplateNotFoundException)
                    {
                        //This directory entry is not a certificate template object.
                    }
                }
            }

            loadedAllTemplates = true;
        }
Beispiel #2
0
 /// <summary>
 /// CertificateTemplateAccessRuleException constructor
 /// </summary>
 /// <param name="Template">An ADCertificateTemplate object</param>
 /// <param name="ex">The exception that occured while doing the Access Rule check</param>
 public CertificateTemplateAccessRuleException(ADCertificateTemplate Template, Exception ex)
     : base($"An exception was encountered retrieving the access rules for certificate template {Template.Name} (OID: {Template.Oid})", ex)
 {
 }