ProfileEncryption
- Namespace:
PPDS.Auth.Profiles - Assembly:
PPDS.Auth - Kind: Class
Summary
Provides platform-specific encryption for sensitive profile data.
Members
Methods
Decrypt
string Decrypt(string encryptedValue)
Decrypts an encrypted string value.
-
Param
encryptedValue: The encrypted value (with or without prefix). -
Returns: The decrypted value.
Encrypt
string Encrypt(string value)
Encrypts a string value using platform-specific encryption.
-
Param
value: The value to encrypt. -
Returns: The encrypted value with
ENCRYPTED:prefix on Windows, or aCLEARTEXT:-prefixed base64 value on other platforms when cleartext caching has been opted in. Returns an empty string whenvalueis null or empty.
IsEncrypted
bool IsEncrypted(string value)
Checks if a value is encrypted (has the ENCRYPTED: or CLEARTEXT: prefix).
-
Param
value: The value to check. -
Returns: True if the value carries one of the known prefixes.
Properties
AllowCleartext
bool AllowCleartext { get; set; }
Process-wide override that, when set to true, allows cleartext persistence on non-Windows platforms. Primarily used by tests.
Fields
AllowCleartextEnvVar
string AllowCleartextEnvVar
Environment variable that, when set to "1" or "true", allows storing profile values as base64-encoded cleartext on platforms without in-process encryption. Intended for CI/CD only.