3 // Copyright (c) Microsoft Corporation. All rights reserved.
6 // <OWNER>Microsoft</OWNER>
10 // IApplicationTrustManager.cs
13 namespace System.Security.Policy {
16 // Interface that defines an IApplicationTrustManager. An IApplicationTrustManager handles application security decisions
17 // when there is no stored policy for that app, be this by prompting the user, checking a web service, or other means.
20 [System.Runtime.InteropServices.ComVisible(true)]
21 public interface IApplicationTrustManager : ISecurityEncodable {
22 ApplicationTrust DetermineApplicationTrust (ActivationContext activationContext, TrustManagerContext context);
26 // This enumeration provides a hint to the trust manager as to the UI it should provide for the trust decision.
29 [System.Runtime.InteropServices.ComVisible(true)]
30 public enum TrustManagerUIContext {
37 // The TrustManagerContext class represents context that the host would like the Trust Manager to consider when making
38 // a run/no-run decision and when setting up the security on a new AppDomain in which to run an application.
39 // This class can be extended by trust managers so it is non-sealed.
42 [System.Runtime.InteropServices.ComVisible(true)]
43 public class TrustManagerContext {
44 private bool m_ignorePersistedDecision;
45 private TrustManagerUIContext m_uiContext;
46 private bool m_noPrompt;
47 private bool m_keepAlive;
48 private bool m_persist;
49 private ApplicationIdentity m_appId;
51 public TrustManagerContext () : this (TrustManagerUIContext.Run) {}
53 public TrustManagerContext (TrustManagerUIContext uiContext) {
54 m_ignorePersistedDecision = false;
55 m_uiContext = uiContext;
60 public virtual TrustManagerUIContext UIContext {
69 public virtual bool NoPrompt {
78 public virtual bool IgnorePersistedDecision {
80 return m_ignorePersistedDecision;
83 m_ignorePersistedDecision = value;
87 public virtual bool KeepAlive {
96 public virtual bool Persist {
105 public virtual ApplicationIdentity PreviousApplicationIdentity {