public CertificateAuthority(String computerName) { if (String.IsNullOrEmpty(computerName)) { throw new ArgumentNullException(nameof(computerName)); } // temporary. Can be overwritten later from more trustworthy source (readInfoFromDsEntry) ComputerName = computerName; IsAccessible = Ping(computerName); _regReader = new CertSrvConfigUtil(computerName); // try to find in AD if possible ICertConfigEntryD dsEntry = lookInDs(computerName); // if we found in AD, then it is easy money. Or read directly from server if (dsEntry != null) { readInfoFromDsEntry(dsEntry); getDistinguishedName(dsEntry); } else { readInfoFromServer(); } _propReader = new CertPropReaderD(ConfigString, false); // read other stuff initialize(); }
CertificateAuthority(ICertConfigEntryD entry) { IsAccessible = Ping(entry.ComputerName); // write basic info from ICertConfig without contacting the server. readInfoFromDsEntry(entry); _regReader = new CertSrvConfigUtil(ComputerName); // Cause delay 2x (1xRegistry, 1xDCOM) _propReader = new CertPropReaderD(ComputerName, false); // read other stuff initialize(); }