Show / Hide Table of Contents

Class SecureStringExtensions

Extensions for the SecureString class.

Inheritance
object
SecureStringExtensions
Inherited Members
object.Equals(object)
object.Equals(object, object)
object.GetHashCode()
object.GetType()
object.MemberwiseClone()
object.ReferenceEquals(object, object)
object.ToString()
Namespace: TheXDS.MCART.Types.Extensions
Assembly: MCART.dll
Syntax
public static class SecureStringExtensions

Methods

| Edit this page View Source

Read(SecureString)

Converts a SecureString to a string.

Declaration
public static string Read(this SecureString value)
Parameters
Type Name Description
SecureString value

The SecureString to convert.

Returns
Type Description
string

A managed string.

Remarks

Using this method is NOT RECOMMENDED, as converting to a string defeats the original purpose of SecureString. It's provided as a simple alternative in cases where the program doesn't rely on maintaining the confidentiality of a specific string during execution.

| Edit this page View Source

ReadBytes(SecureString)

Converts a SecureString to an array of byte.

Declaration
public static byte[] ReadBytes(this SecureString value)
Parameters
Type Name Description
SecureString value

The SecureString to convert.

Returns
Type Description
byte[]

A managed array of byte.

Remarks

The byte array read corresponds to a UTF-16 string.

| Edit this page View Source

ReadChars(SecureString)

Converts a SecureString to an array of char.

Declaration
public static char[] ReadChars(this SecureString value)
Parameters
Type Name Description
SecureString value

The SecureString to convert.

Returns
Type Description
char[]

A managed array of char.

| Edit this page View Source

ReadInt16(SecureString)

Converts a SecureString to an array of short.

Declaration
public static short[] ReadInt16(this SecureString value)
Parameters
Type Name Description
SecureString value

The SecureString to convert.

Returns
Type Description
short[]

A managed array of short.

| Edit this page View Source

ToBase64(SecureString)

Converts a SecureString to a Base64 formatted string.

Declaration
public static string ToBase64(this SecureString value)
Parameters
Type Name Description
SecureString value

The SecureString to convert.

Returns
Type Description
string

A Base64 formatted string.

Remarks

The byte array read before conversion to Base64 corresponds to a UTF-16 string.

  • Edit this page
  • View Source
In this article
Back to top Generated by DocFX