Advertisement
Guest User

Untitled

a guest
Jun 19th, 2019
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.42 KB | None | 0 0
  1. public static IDataProtectionBuilder AddCaDataProtection(this IServiceCollection services)
  2. {
  3. const string applicationName = "CertificationAuthority";
  4. var registryKey = Registry.CurrentUser.CreateSubKey($@"SOFTWARE{applicationName}keys");
  5. return services
  6. .AddDataProtection()
  7. .SetApplicationName(applicationName)
  8. .ProtectKeysWithDpapi()
  9. .PersistKeysToRegistry(registryKey);
  10. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement