SecureStringHelper

Ecng.Serialization

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.

Eigenschaften

CurrentEncryptor
public static ISecureStringEncryptor CurrentEncryptor { get; }
value = SecureStringHelper.CurrentEncryptor

The encryptor active in the current async flow.

Encryptor
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 .

Methoden

Decrypt
public static SecureString Decrypt(byte[] cipher)
result = SecureStringHelper.Decrypt(cipher)

Decrypts previously produced by SecureString).

cipher
Encrypted bytes; returns .

Rückgabe: Original SecureString, or when is .

Encrypt
public static byte[] Encrypt(SecureString value)
result = SecureStringHelper.Encrypt(value)

Encrypts to a byte array.

value
SecureString to encrypt; returns .

Rückgabe: Encrypted bytes, or when is .