Class DpapiConnectionPasswordProtector
- Namespace
- ItTiger.TigerQuery.Core
- Assembly
- ItTiger.TigerQuery.Core.dll
Protects non-empty plain-text profile passwords with current-user Windows DPAPI.
public sealed class DpapiConnectionPasswordProtector : IConnectionPasswordProtector
- Inheritance
-
DpapiConnectionPasswordProtector
- Implements
- Inherited Members
Remarks
DPAPI ciphertext is tied to the Windows user and is not portable to another
user or platform. Decryption failure leaves PlainPassword
unchanged rather than throwing.
Methods
ProtectForSave(SqlServerConnectionProfile)
Prepares a profile's password fields for JSON persistence.
public void ProtectForSave(SqlServerConnectionProfile profile)
Parameters
profileSqlServerConnectionProfile- The mutable profile about to be serialized.
Exceptions
- ArgumentNullException
profileis null.- PlatformNotSupportedException
- A non-empty plain password is supplied on a platform without Windows DPAPI.
UnprotectAfterLoad(SqlServerConnectionProfile)
Restores usable in-memory password fields after JSON deserialization.
public void UnprotectAfterLoad(SqlServerConnectionProfile profile)
Parameters
profileSqlServerConnectionProfile- The mutable profile that was loaded.
Exceptions
- ArgumentNullException
profileis null.