/// <summary> /// Configures the data protection system to persist keys to the Windows registry. /// </summary> /// <param name="registryKey">The location in the registry where keys should be stored.</param> /// <returns>The 'this' instance.</returns> public DataProtectionConfiguration PersistKeysToRegistry(RegistryKey registryKey) { if (registryKey == null) { throw new ArgumentNullException(nameof(registryKey)); } Use(DataProtectionServiceDescriptors.IXmlRepository_Registry(registryKey)); return(this); }
/// <summary> /// Configures the data protection system to persist keys to the Windows registry. /// </summary> /// <param name="builder">The <see cref="IDataProtectionBuilder"/>.</param> /// <param name="registryKey">The location in the registry where keys should be stored.</param> /// <returns>A reference to the <see cref="IDataProtectionBuilder" /> after this operation has completed.</returns> public static IDataProtectionBuilder PersistKeysToRegistry(this IDataProtectionBuilder builder, RegistryKey registryKey) { if (builder == null) { throw new ArgumentNullException(nameof(builder)); } if (registryKey == null) { throw new ArgumentNullException(nameof(registryKey)); } Use(builder.Services, DataProtectionServiceDescriptors.IXmlRepository_Registry(registryKey)); return(builder); }