/// <summary> /// Displays the properties of a certificate. /// </summary> internal void Initialize(Opc.Ua.Security.SecuredApplication application) { ItemsLV.Items.Clear(); if (application == null) { Instructions = "No application properties to display"; AdjustColumns(); return; } AddItem(new FieldInfo("ApplicationName", application.ApplicationName)); AddItem(new FieldInfo("ApplicationUri", application.ApplicationUri)); AddItem(new FieldInfo("ProductName", application.ProductName)); AddItem(new FieldInfo("ApplicationType", application.ApplicationType)); AddItem(new FieldInfo("ConfigurationFile", application.ConfigurationFile)); AddItem(new FieldInfo("ExecutableFile", application.ExecutableFile)); AdjustColumns(); }
/// <summary> /// Updates the access permissions for the certificate store. /// </summary> private static void SetCertificatePermissions( Opc.Ua.Security.SecuredApplication application, CertificateIdentifier id, IList <ApplicationAccessRule> accessRules, bool replaceExisting) { if (id == null || accessRules == null || accessRules.Count == 0) { return; } try { using (ICertificateStore store = id.OpenStore()) { if (store.SupportsCertificateAccessControl) { store.SetAccessRules(id.Thumbprint, accessRules, replaceExisting); } } } catch (Exception e) { Utils.Trace("Could not set permissions for certificate store: {0}. Error={1}", id, e.Message); for (int jj = 0; jj < accessRules.Count; jj++) { ApplicationAccessRule rule = accessRules[jj]; Utils.Trace( (int)Utils.TraceMasks.Error, "IdentityName={0}, Right={1}, RuleType={2}", rule.IdentityName, rule.Right, rule.RuleType); } } }