-
Notifications
You must be signed in to change notification settings - Fork 19
Open
Description
Hi,
I created an SSL certificate with an export password, and I noticed that I can provide this password in my .NET code using crypter.CertificateLoader option of ConfigureAppConfiguration, this way:
public static IWebHostBuilder CreateWebHostBuilder(string[] args) =>
WebHost.CreateDefaultBuilder(args)
.UseStartup<Startup>()
.ConfigureAppConfiguration(cfg =>
{
cfg.AddEncryptedAppSettings(crypter =>
{
crypter.KeysToDecrypt = new List<string> { "ConnectionStrings:DefaultConnection" };
crypter.CertificateLoader = new MyCertificateLoader();
});
});
public class MyCertificateLoader : ICertificateLoader
{
public X509Certificate2 LoadCertificate()
{
return new X509Certificate2("mycert.pfx", "mypassword", X509KeyStorageFlags.MachineKeySet);
}
}
But I could not find any way to provide this password to the command I use in the cmd!
config-crypter encrypt -p mycert.pfx -f appsettings.json -k "ConnectionStrings.DefaultConnection"
config-crypter decrypt-p mycert.pfx -f appsettings.json -k "ConnectionStrings.DefaultConnection"
Is there a way to do so?
Metadata
Metadata
Assignees
Labels
No labels