Skip to content
Tracon

TraconContentProtectionExtensions

Namespace Tracon · Assembly Tracon.Core.dll

Chain extensions that turn on at-rest content protection.

public static class TraconContentProtectionExtensions

objectTraconContentProtectionExtensions

object.GetType(), object.MemberwiseClone(), object.ToString(), object.Equals(object?), object.Equals(object?, object?), object.ReferenceEquals(object?, object?), object.GetHashCode()

This is an extension method, not a member of ITraconBuilder: adding a member to the interface is a breaking change after release; adding an extension method is not.

AddContentProtection(ITraconBuilder, Action<TraconContentProtectionOptions>?)

Section titled “ AddContentProtection(ITraconBuilder, Action<TraconContentProtectionOptions>?)”

Registers Tracon’s built-in AES-256-GCM content protector.

public static ITraconBuilder AddContentProtection(this ITraconBuilder builder, Action<TraconContentProtectionOptions>? configure = null)

builder ITraconBuilder

The configuration chain.

configure Action<TraconContentProtectionOptions>?

Key and column settings.

ITraconBuilder

The chain, for further configuration.

This call is the no-surprises rule’s gate. AddTracon alone registers a no-op protector that writes plaintext unchanged; without this call (or a matching Tracon:ContentProtection:Enabled configuration section), nothing is encrypted.

Replaces the default registration rather than adding to it — a consumer’s explicit call always wins over Tracon’s own default (the same rule UsePostgreSql follows for its stores).

builder.AddTracon()
.AddContentProtection(options =>
{
options.ActiveKeyId = "2026-08";
options.Keys["2026-08"] = "ContentProtectionKeys:2026-08";
});

ArgumentNullException

builder is null.

AddContentProtection<TProtector>(ITraconBuilder)

Section titled “ AddContentProtection<TProtector>(ITraconBuilder)”

Registers your own IContentProtector implementation.

public static ITraconBuilder AddContentProtection<TProtector>(this ITraconBuilder builder) where TProtector : class, IContentProtector

builder ITraconBuilder

The configuration chain.

ITraconBuilder

The chain, for further configuration.

TProtector

The protector type.

TraconContentProtectionOptions.Columns still governs which columns are protected, whichever implementation is registered; only the actual protect/unprotect logic is replaced.

ArgumentNullException

builder is null.