+xMy suspicion is this is related to the private key. Have you tried something like the following? new X509Certificate2( Convert.FromBase64String(certContentSecret.Value), string.Empty, X509KeyStorageFlags.MachineKeySet | X509KeyStorageFlags.Exportable | X509KeyStorageFlags.EphemeralKeySet);
The EphemeralKeySet flag specifies that the private key should not persisted to disk. We've tried: new X509Certificate2( Convert.FromBase64String(certContentSecret.Value), string.Empty, X509KeyStorageFlags.MachineKeySet | X509KeyStorageFlags.PersistKeySet | X509KeyStorageFlags.Exportable);
Shouldn't the PersistKeySet option have fixed the issue as then the key files will not be deleted upon certificate disposal? Also we are targetting netstandard 2.0 and the option for "EphemeralKeySet" was introduced in .netstandard 2.1. We have a lot of dependencies on this project so not sure if we could just upgrade to 2.1
|