Ejemplo n.º 1
0
 public static System.Security.Policy.ApplicationTrust RequestTrust(SubscriptionState subState, bool isShellVisible, bool isUpdate, ActivationContext actCtx)
 {
     return(ApplicationTrust.RequestTrust(subState, isShellVisible, isUpdate, actCtx, new TrustManagerContext()
     {
         IgnorePersistedDecision = false,
         NoPrompt = false,
         Persist = true
     }));
 }
Ejemplo n.º 2
0
 public void PersistTrustWithoutEvaluation()
 {
     try
     {
         this._actDesc.Trust = ApplicationTrust.PersistTrustWithoutEvaluation(this._actCtx);
     }
     catch (Exception ex)
     {
         this._trustNotGrantedEvent.Set();
         throw;
     }
     this._trustGrantedEvent.Set();
 }
Ejemplo n.º 3
0
 private bool DetermineTrustCore(bool blocking, TrustParams tp)
 {
     try
     {
         Logger.AddMethodCall(this._log, "DeploymentManager.DetermineTrustCore() called.");
         SubscriptionState   subscriptionState = this._subStore.GetSubscriptionState(this._actDesc.DeployManifest);
         TrustManagerContext tmc = new TrustManagerContext();
         tmc.IgnorePersistedDecision = false;
         tmc.NoPrompt = false;
         tmc.Persist  = true;
         if (tp != null)
         {
             tmc.NoPrompt = tp.NoPrompt;
         }
         if (!blocking && this._cancellationPending)
         {
             return(true);
         }
         if (subscriptionState.IsInstalled && !string.Equals(subscriptionState.EffectiveCertificatePublicKeyToken, this._actDesc.EffectiveCertificatePublicKeyToken, StringComparison.Ordinal))
         {
             Logger.AddInternalState(this._log, "Application family is installed but effective certificate public key token has changed between versions: subState.EffectiveCertificatePublicKeyToken=" + subscriptionState.EffectiveCertificatePublicKeyToken + ",_actDesc.EffectiveCertificatePublicKeyToken=" + this._actDesc.EffectiveCertificatePublicKeyToken);
             Logger.AddInternalState(this._log, "Removing cached trust for the CurrentBind.");
             ApplicationTrust.RemoveCachedTrust(subscriptionState.CurrentBind);
         }
         bool isUpdate = false;
         if (this._actDesc.IsUpdate)
         {
             isUpdate = true;
         }
         if (this._actDesc.IsUpdateInPKTGroup)
         {
             isUpdate = false;
             this._actDesc.IsFullTrustRequested = new ApplicationSecurityInfo(this._actCtx).DefaultRequestSet.IsUnrestricted();
         }
         this._actDesc.Trust = ApplicationTrust.RequestTrust(subscriptionState, this._actDesc.DeployManifest.Deployment.Install, isUpdate, this._actCtx, tmc);
     }
     catch (Exception ex)
     {
         this.LogError(Resources.GetString("Ex_DetermineTrustFailed"), ex);
         Logger.AddInternalState(this._log, "Exception thrown in  DetermineTrustCore(): " + ex.GetType().ToString() + " : " + ex.Message + "\r\n" + ex.StackTrace);
         throw;
     }
     return(false);
 }