In ASP.NET (not core) I would normally add a machineKey to the web.config so that I could perform some functions on a local machine instead of the server so that database/ca
You can find good examples at https://docs.microsoft.com/en-us/aspnet/core/security/data-protection/implementation/key-storage-providers?view=aspnetcore-2.2&tabs=visual-studio
I used my database context to persist the keys across multiple instances.
DbContext.cs
public class MyContext : IDataProtectionKeyContext
{
...
// This maps to the table that stores keys.
public DbSet DataProtectionKeys { get; set; }
}
Startup.cs
public void ConfigureServices(IServiceCollection services)
{
...
services.AddDataProtection().PersistKeysToDbContext();
}