Skip to content

Credential.cs

Avrigeanu Laurian edited this page Apr 14, 2023 · 2 revisions

Description

The Credential class represents a set of credentials consisting of a Name string and a SecureString Value.

Properties

  • Name: A string representing the name of the credential.
  • Value: A SecureString representing the value of the credential.

Constructors

  • Credential(): Initializes a new instance of the Credential class with default values.
  • Credential(string name, SecureString value): Initializes a new instance of the Credential class with the specified name and value.

Remarks

The Credential class is commonly used to store sensitive information such as passwords, API keys, or access tokens. The SecureString class is used to provide additional protection for the sensitive data by storing it in memory in an encrypted form.

It is recommended to use Credential instances only when necessary, and to dispose of them as soon as they are no longer needed to reduce the risk of the sensitive information being exposed. When creating Credential instances, it is important to securely dispose of the SecureString object containing the sensitive data after it is no longer needed.

Clone this wiki locally