Skip to content

Commit

Permalink
Merge pull request #1536 from DuendeSoftware/releases/7.0.x
Browse files Browse the repository at this point in the history
Merge 7.0.3 forward to main
  • Loading branch information
brockallen committed Mar 21, 2024
2 parents dd3d584 + 1bb29dd commit b0abc41
Showing 1 changed file with 1 addition and 1 deletion.
Expand Up @@ -100,7 +100,7 @@ public override AsymmetricSecurityKey ToSecurityKey()
// handling this as it typically means the user profile is not loaded, and this is about the best way to detect this.
// when the user profile is not loaded, using X509KeyStorageFlags.MachineKeySet is the only way for this to work on windows.
// https://stackoverflow.com/questions/52750160/what-is-the-rationale-for-all-the-different-x509keystorageflags/52840537#52840537
catch (Exception ex) when (ex.GetType().Name == "WindowsCryptographicException")
catch (CryptographicException ex) when (ex.HResult == unchecked((int)0x80070002)) // File not found
{
_cert = new X509Certificate2(Convert.FromBase64String(CertificateRawData), (string) null, X509KeyStorageFlags.MachineKeySet);
}
Expand Down

0 comments on commit b0abc41

Please sign in to comment.