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 IConnectionStringProtectorMethods
Protect(string)
Encrypts connectionString for cache storage.
string Protect(string connectionString)Parameters:
connectionStringstring: The connection string to protect.
Returns: string
Unprotect(string)
Decrypts a previously IConnectionStringProtector.Protect-ed value.
string Unprotect(string protectedConnectionString)Parameters:
protectedConnectionStringstring: A connection string returned byIConnectionStringProtector.Protect.
Returns: string