/// <summary> /// Load up the properties of the CA from the CA config file /// </summary> /// <param name="ConfigFileName">Pathname of the CA config file</param> public CaControl(string ConfigFileName) { configFileName = ConfigFileName; XDocument doc; if (XmlSigning.VerifyXmlFile(configFileName)) { doc = XDocument.Load(ConfigFileName); } else { throw new GeneralSecurityException("Signature failed on CA config file"); } XElement config = doc.Element("OSCA").Element("CA"); version = doc.Element("OSCA").Attribute("version").Value; name = config.Element("name").Value; role = config.Element("type").Value; created = config.Element("created").Value; dbFileLocation = config.Element("dbFileLocation").Value; publicKeyAlgorithm = config.Element("publicKeyAlgorithm").Value + "-" + config.Element("publicKeySize").Value; signatureAlgorithm = config.Element("signatureAlgorithm").Value; fips140 = Convert.ToBoolean(config.Element("fips140").Value); lastSerial = config.Element("lastSerial").Value; crlFileLocation = config.Element("crlFileLocation").Value; lastCRL = config.Element("lastCRL").Value; crlInterval = config.Element("crlInterval").Value; profilesLocation = config.Element("profilesLocation").Value; certificate = null; currentCerts = new CaDB(dbFileLocation, CertStatus.Current); revokedCerts = new CaDB(dbFileLocation, CertStatus.Revoked); expiredCerts = new CaDB(dbFileLocation, CertStatus.Expired); profiles = new profileDB(profilesLocation); if ((version == "3.0") || (version == "3.1")) { caType = Utility.SetCA_Type(config.Element("caType").Value); } }
public void RefreshProfiles() { this.profiles = new profileDB(profilesLocation); }