When you need to encrypt something with .NET Core, probably the best solution is using IDataProtectionProvider interface, already built in in the environment. Lets see how you can simplify configuration and make it simple with Self Signed Certificate
Developers are usually not friend of TLS, always running everything without TLS during development and disabling all protections to allow unencrypted traffic. This is a problem that can lead to problems in production. Lets examine how to use a local KeyCloak instance with a perfectly valid TLS certificate