Class DataProtectionOptions
C10 — DataProtection at-rest hardening.
Three variants are supported (in priority order if multiple are set):
Custom KMS via — caller supplies an
IXmlEncryptor wired to Vault / Azure Key Vault / AWS KMS / etc.X.509 certificate via — thumbprint lookup in
the local store, or PFX path on disk. Cross-platform; preferred for cluster.AES-GCM master key via — 32-byte key in base64.
Smallest deployments / single-node dev.
If is true AND
is false AND none of the above
is configured, AddRedbIdentityServer throws on startup.
Migration: existing plaintext key-ring entries stay readable
(ASP.NET DataProtection handles mixed plain+encrypted entries natively).
New keys written after enabling encryption are encrypted; rotation eventually
retires the plaintext entries.
public sealed class DataProtectionOptions
Inheritance
Properties
Certificate
X.509 certificate options. If
public DataProtectionCertificateOptions Certificate { get; set; }
CustomEncryptorFactory
Optional callback that returns a custom IXmlEncryptor. The
public Func<IServiceProvider, IXmlEncryptor>? CustomEncryptorFactory { get; set; }
HasEncryptorConfigured
True when at least one of the three variants is configured.
public bool HasEncryptorConfigured { get; }
ImportKeysFromPath
A file key ring directory to import into redb at startup, in addition to the ASP.NET Core default
public string? ImportKeysFromPath { get; set; }
MasterKey
32-byte AES-256 key, base64-encoded. Used by the built-in
public string? MasterKey { get; set; }
RequireAtRestEncryption
When true (default) and ephemeral keys are not allowed, startup fails
public bool RequireAtRestEncryption { get; set; }