Represents text that should be kept confidential, such as by deleting it from computer memory when no longer needed. This class cannot be inherited.
More...
|
| SecureString () |
| Initializes a new instance of the T:System.Security.SecureString class. More...
|
|
unsafe | SecureString (char *value, int length) |
| Initializes a new instance of the T:System.Security.SecureString class from a subarray of T:System.Char objects. This constructor is not CLS-compliant. The CLS-compliant alternative is M:System.Security.SecureString.::ctor. More...
|
|
void | AppendChar (char c) |
| Appends a character to the end of the current secure string. More...
|
|
void | Clear () |
| Deletes the value of the current secure string. More...
|
|
SecureString | Copy () |
| Creates a copy of the current secure string. More...
|
|
void | Dispose () |
| Releases all resources used by the current T:System.Security.SecureString object. More...
|
|
unsafe void | InsertAt (int index, char c) |
| Inserts a character in this secure string at the specified index position. More...
|
|
bool | IsReadOnly () |
| Indicates whether this secure string is marked read-only. More...
|
|
void | MakeReadOnly () |
| Makes the text value of this secure string read-only. More...
|
|
unsafe void | RemoveAt (int index) |
| Removes the character at the specified index position from this secure string. More...
|
|
void | SetAt (int index, char c) |
| Replaces the existing character at the specified index position with another character. More...
|
|
|
int | Length [get] |
| Gets the number of characters in the current secure string. More...
|
|
Represents text that should be kept confidential, such as by deleting it from computer memory when no longer needed. This class cannot be inherited.
Definition at line 11 of file SecureString.cs.
◆ SecureString() [1/2]
System.Security.SecureString.SecureString |
( |
| ) |
|
Initializes a new instance of the T:System.Security.SecureString class.
- Exceptions
-
T:System.Security.Cryptography.CryptographicException | An error occurred while protecting or unprotecting the value of this instance. |
T:System.NotSupportedException | This operation is not supported on this platform. |
Definition at line 87 of file SecureString.cs.
◆ SecureString() [2/2]
unsafe System.Security.SecureString.SecureString |
( |
char * |
value, |
|
|
int |
length |
|
) |
| |
Initializes a new instance of the T:System.Security.SecureString class from a subarray of T:System.Char objects. This constructor is not CLS-compliant. The CLS-compliant alternative is M:System.Security.SecureString.::ctor.
- Parameters
-
value | A pointer to an array of T:System.Char objects. |
length | The number of elements of value to include in the new instance. |
- Exceptions
-
T:System.ArgumentNullException | value is null . |
T:System.ArgumentOutOfRangeException | length is less than zero or greater than 65,536. |
T:System.Security.Cryptography.CryptographicException | An error occurred while protecting or unprotecting the value of this secure string. |
T:System.NotSupportedException | This operation is not supported on this platform. |
Definition at line 134 of file SecureString.cs.
◆ AppendChar()
void System.Security.SecureString.AppendChar |
( |
char |
c | ) |
|
Appends a character to the end of the current secure string.
- Parameters
-
c | A character to append to this secure string. |
- Exceptions
-
T:System.ObjectDisposedException | This secure string has already been disposed. |
T:System.InvalidOperationException | This secure string is read-only. |
T:System.ArgumentOutOfRangeException | Performing this operation would make the length of this secure string greater than 65,536 characters. |
T:System.Security.Cryptography.CryptographicException | An error occurred while protecting or unprotecting the value of this secure string. |
Definition at line 160 of file SecureString.cs.
◆ Clear()
void System.Security.SecureString.Clear |
( |
| ) |
|
Deletes the value of the current secure string.
- Exceptions
-
T:System.ObjectDisposedException | This secure string has already been disposed. |
T:System.InvalidOperationException | This secure string is read-only. |
Definition at line 188 of file SecureString.cs.
◆ Copy()
Creates a copy of the current secure string.
- Returns
- A duplicate of this secure string.
- Exceptions
-
T:System.ObjectDisposedException | This secure string has already been disposed. |
T:System.Security.Cryptography.CryptographicException | An error occurred while protecting or unprotecting the value of this secure string. |
Definition at line 203 of file SecureString.cs.
◆ Dispose()
void System.Security.SecureString.Dispose |
( |
| ) |
|
◆ InsertAt()
unsafe void System.Security.SecureString.InsertAt |
( |
int |
index, |
|
|
char |
c |
|
) |
| |
Inserts a character in this secure string at the specified index position.
- Parameters
-
index | The index position where parameter c is inserted. |
c | The character to insert. |
- Exceptions
-
T:System.ObjectDisposedException | This secure string has already been disposed. |
T:System.InvalidOperationException | This secure string is read-only. |
T:System.ArgumentOutOfRangeException | index is less than zero, or greater than the length of this secure string.-or-Performing this operation would make the length of this secure string greater than 65,536 characters. |
T:System.Security.Cryptography.CryptographicException | An error occurred while protecting or unprotecting the value of this secure string. |
Definition at line 232 of file SecureString.cs.
◆ IsReadOnly()
bool System.Security.SecureString.IsReadOnly |
( |
| ) |
|
Indicates whether this secure string is marked read-only.
- Returns
true
if this secure string is marked read-only; otherwise, false
.
- Exceptions
-
T:System.ObjectDisposedException | This secure string has already been disposed. |
Definition at line 276 of file SecureString.cs.
◆ MakeReadOnly()
void System.Security.SecureString.MakeReadOnly |
( |
| ) |
|
Makes the text value of this secure string read-only.
- Exceptions
-
T:System.ObjectDisposedException | This secure string has already been disposed. |
Definition at line 286 of file SecureString.cs.
◆ RemoveAt()
unsafe void System.Security.SecureString.RemoveAt |
( |
int |
index | ) |
|
Removes the character at the specified index position from this secure string.
- Parameters
-
index | The index position of a character in this secure string. |
- Exceptions
-
T:System.ObjectDisposedException | This secure string has already been disposed. |
T:System.InvalidOperationException | This secure string is read-only. |
T:System.ArgumentOutOfRangeException | index is less than zero, or greater than or equal to the length of this secure string. |
T:System.Security.Cryptography.CryptographicException | An error occurred while protecting or unprotecting the value of this secure string. |
Definition at line 302 of file SecureString.cs.
◆ SetAt()
void System.Security.SecureString.SetAt |
( |
int |
index, |
|
|
char |
c |
|
) |
| |
Replaces the existing character at the specified index position with another character.
- Parameters
-
index | The index position of an existing character in this secure string |
c | A character that replaces the existing character. |
- Exceptions
-
T:System.ObjectDisposedException | This secure string has already been disposed. |
T:System.InvalidOperationException | This secure string is read-only. |
T:System.ArgumentOutOfRangeException | index is less than zero, or greater than or equal to the length of this secure string. |
T:System.Security.Cryptography.CryptographicException | An error occurred while protecting or unprotecting the value of this secure string. |
Definition at line 349 of file SecureString.cs.
◆ Length
int System.Security.SecureString.Length |
|
get |
Gets the number of characters in the current secure string.
- Returns
- The number of T:System.Char objects in this secure string.
- Exceptions
-
T:System.ObjectDisposedException | This secure string has already been disposed. |
Definition at line 34 of file SecureString.cs.
The documentation for this class was generated from the following file: