Azure web application sporadically throws CryptographicException: Keyset does not exist

I have a web application Identity Serverhosted on Azure. It has a file .pfxin the root directory for signing it. The problem is that when it was recently published, it works fine, but after a while it starts throwingCryptographicException: Keyset does not exist.

Based on CryptographicException KeySet does not exist. I would suggest that this is a problem with access to the file, but why access to the file will be spoiled from a sudden lazurine.

+4
source share
2 answers

, . - Azure Portal.

- .

X509Certificate2 Certificate = null;
var certStore = new X509Store(StoreName.My, StoreLocation.CurrentUser);
certStore.Open(OpenFlags.ReadOnly | OpenFlags.OpenExistingOnly);
var certCollection = certStore.Certificates.Find(X509FindType.FindByThumbprint,"CERTIFICATE_THUMBPRINT_HERE",false);
Certificate = certCollection[0];
0

. . services.AddDataProtection() Azure App Service %HOME%\ASP.NET\DataProtection-keys. , , , . . , , , CryptographicException: Keyset does not exist, .

, . Redis Azure Blob Storage .

, , .

, .

0

Source: https://habr.com/ru/post/1654712/


All Articles