/// <summary> /// Loads the profile. /// </summary> /// <param name="profile">The profile.</param> protected virtual void loadProfile(XDocument profile) { XElement baseInfo = profile.Element("OSCA").Element("Profile"); // Extract the base information Name = baseInfo.Element("name").Value; Description = baseInfo.Element("description").Value; Version = baseInfo.Element("version").Value; CertificateLifetime = new ValidityPeriod(baseInfo.Element("lifetime")); if (baseInfo.Element("renewOverlap") != null) { RenewOverlapPeriod = new ValidityPeriod(baseInfo.Element("renewOverlap")); } else { RenewOverlapPeriod = new ValidityPeriod(ValidityPeriod.Unit.Hours, 0); } // Populate the list of Extensions IEnumerable <XElement> exts = baseInfo.Element("Extensions").Elements("Extension"); foreach (XElement ext in exts) { extensions.Add(ProfileExtensionFactory.GetExtension(ext)); } }
/// <summary> /// Create a Profile instance from an X509Extensions object /// </summary> /// <param name="Extensions">X509Extensions object</param> public Profile(X509Extensions Extensions) { foreach (DerObjectIdentifier oid in Extensions.ExtensionOids) { extensions.Add(ProfileExtensionFactory.GetExtension(oid, Extensions.GetExtension(oid))); } }