private static void ChangeHandler()
        {
            HashSet <string> certificatesThumbprint = ApplicationPoolRecycler.GetCertificatesThumbprint();

            if (!certificatesThumbprint.SetEquals(ApplicationPoolRecycler.initialCertificates))
            {
                ApplicationPoolRecycler.RecycleThisApplicationPool();
            }
        }
 public static void EnableOnFederationTrustCertificateChange()
 {
     if (!ApplicationPoolRecycler.enabled)
     {
         lock (ApplicationPoolRecycler.locker)
         {
             if (!ApplicationPoolRecycler.enabled)
             {
                 ApplicationPoolRecycler.initialCertificates = ApplicationPoolRecycler.GetCertificatesThumbprint();
                 FederationTrustCache.Change    += ApplicationPoolRecycler.ChangeHandler;
                 ApplicationPoolRecycler.enabled = true;
             }
         }
     }
 }