StringExtensionsToUnsecureString Method

Converts the given SecureString into a String.

Definition

Namespace: Gemstone.StringExtensions
Assembly: Gemstone.Common (in Gemstone.Common.dll) Version: 1.0.128 -- Release Build+d050cfc5563c89a1188cc3c6b2d417530856f490
public static string? ToUnsecureString(
	this SecureString? value
)

Parameters

value  SecureString
The SecureString to be converted.

Return Value

String
The given SecureString as a String.

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type SecureString. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).

Remarks

This method is not safe, as it stores your secure string data in clear text in memory. Since strings are immutable, that memory cannot be cleaned up until all references to the string are removed and the garbage collector deallocates it. Only use this method to interface with APIs that do not support the use of SecureString for sensitive text data.

See Also