Docs
Tenantry ProAPI reference

IConnectionStringProtector interface

Namespace: Tenantry.Pro.Strategies.DatabasePerTenant · Package: Tenantry.Pro · API reference

Encrypts and decrypts connection strings for at-rest protection in the connection string cache. Implement this interface and register it in DI when using ConnectionStringEncryptionMode.Custom.

The protector is only applied to values stored in the cache. ITenantConnectionStringResolver<TKey> always returns plaintext to callers — encryption is transparent.

public interface IConnectionStringProtector

Methods

Protect(string)

Encrypts connectionString for cache storage.

string Protect(string connectionString)

Parameters:

  • connectionString string: The connection string to protect.

Returns: string

Unprotect(string)

Decrypts a previously IConnectionStringProtector.Protect-ed value.

string Unprotect(string protectedConnectionString)

Parameters:

Returns: string

On this page