views:

24

answers:

0

I need to deploy my web-application on web-farm. Application has the following strings:

public static X509Certificate2 GetIdCertificate()
{
    string cacheKey = "IdentityProvider.PrivateKey";

    if (HttpContext.Current.Cache[cacheKey] == null)
    {                
        //Load new.
        HttpContext.Current.Cache[cacheKey] = new X509Certificate2(
        System.Web.HttpContext.Current.Server.MapPath("~/") + "\\ID\\" +
        IdentityProvider.BLL.IdConfig.Instance.IdPKeyFile, 
        IdentityProvider.BLL.IdConfig.Instance.IdPKeyPassword,
        X509KeyStorageFlags.MachineKeySet);
    }

    return (X509Certificate2)HttpContext.Current.Cache[cacheKey];
}

will it work or not? If not then how to solve and what is solution?

Thanks