Early Preview

This is currently very much a preview. Please feel free to try things out, but don't be upset if anything is not yet working. Feedback is welcome over on our GitHub Dicussions page.

class System.​Security.​SecureString

Assembly: System.Runtime.InteropServices

Inheritance: object → SecureString

Represents text that should be kept confidential, such as by deleting it from computer memory when no longer needed. This class cannot be inherited.

Properties

public int
Length
Gets the number of characters in the current secure string.

Methods

public void
AppendChar​(char c)
c A character to append to this secure string.
Appends a character to the end of the current secure string.
public void
Clear​()
Deletes the value of the current secure string.
public SecureString
Copy​()
Returns A duplicate of this secure string.
Creates a copy of the current secure string.
public void
Dispose​()
Releases all resources used by the current <see cref="T:System.Security.SecureString" /> object.
public void
InsertAt​(int index, char c)
index The index position where parameter <paramref name="c" /> is inserted.
c The character to insert.
Inserts a character in this secure string at the specified index position.
public bool
IsReadOnly​()
Returns <see langword="true" /> if this secure string is marked read-only; otherwise, <see langword="false" /> .
Indicates whether this secure string is marked read-only.
public void
MakeReadOnly​()
Makes the text value of this secure string read-only.
public void
RemoveAt​(int index)
index The index position of a character in this secure string.
Removes the character at the specified index position from this secure string.
public void
SetAt​(int index, char c)
index The index position of an existing character in this secure string.
c A character that replaces the existing character.
Replaces the existing character at the specified index position with another character.
public bool
Equals​(object obj)
Inherited from object
protected void
Finalize​()
Inherited from object
public int
GetHashCode​()
Inherited from object
public Type
GetType​()
Inherited from object
protected object
MemberwiseClone​()
Inherited from object
public string
ToString​()
Inherited from object