SecureStringHelper
Public facade over the active ISecureStringEncryptor: encrypts and decrypts SecureString payloads using the same encryptor the JSON / SettingsStorage primitive path applies. Assign Encryptor to replace the secret or algorithm process-wide, or use Scope for a local ISecureStringEncryptor override.
Свойства
public static ISecureStringEncryptor CurrentEncryptor { get; }
value = SecureStringHelper.CurrentEncryptor
The encryptor active in the current async flow.
public static ISecureStringEncryptor Encryptor { get; set; }
value = SecureStringHelper.Encryptor
SecureStringHelper.Encryptor = value
The encryptor used by SecureString) / Byte[]) and by the JSON / SettingsStorage primitive path. Defaults to the built-in AES SecureStringEncryptor; assign your own implementation to override the secret or algorithm for the whole process. Cannot be set to .
Методы
public static SecureString Decrypt(byte[] cipher)
result = SecureStringHelper.Decrypt(cipher)
Decrypts previously produced by SecureString).
- cipher
- Encrypted bytes; returns .
Возвращает: Original SecureString, or when is .
public static byte[] Encrypt(SecureString value)
result = SecureStringHelper.Encrypt(value)
Encrypts to a byte array.
- value
- SecureString to encrypt; returns .
Возвращает: Encrypted bytes, or when is .