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
Implemented Interfaces
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)
Appends a character to the end of the current secure string.
c
A character to append to this secure string.
public
void
Clear​()
Deletes the value of the current secure string.
Returns A duplicate of this 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)
Inserts a character in this secure string at the specified index position.
index
The index position where parameter <paramref name="c" /> is inserted.
c
The character to insert.
public
bool
IsReadOnly​()
Indicates whether this secure string is marked read-only.
Returns <see langword="true" /> if this secure string is marked read-only; otherwise, <see langword="false" /> .
public
void
MakeReadOnly​()
Makes the text value of this secure string read-only.
public
void
RemoveAt​(int index)
Removes the character at the specified index position from this secure string.
index
The index position of a character in this secure string.
public
void
SetAt​(int index,
char c)
Replaces the existing character at the specified index position with another character.
index
The index position of an existing character in this secure string.
c
A character that replaces the existing character.
public
bool
Equals​(object obj)
Inherited from object
protected
void
Finalize​()
Inherited from object
public
int
GetHashCode​()
Inherited from object
protected
object
MemberwiseClone​()
Inherited from object
public
string
ToString​()
Inherited from object