Class Password
Represents a password with its hash, salt and algorithm used for encryption.
Namespace: CapyKit
Assembly: CapyKit.dll
Syntax
public class Password
Constructors
Password(string, byte[], IPasswordAlgorithm, params object[])
Constructor.
Declaration
public Password(string password, byte[] salt, IPasswordAlgorithm algorithm, params object[] args)
Parameters
| Type | Name | Description |
|---|---|---|
| string | password | The password to be hashed. |
| byte[] | salt | The salt used for encryption. |
| IPasswordAlgorithm | algorithm | The algorithm used for password encryption. |
| object[] | args | A variable-length parameters list containing arguments to include for the |
Properties
Algorithm
Gets or sets the algorithm used for password encryption.
Declaration
public IPasswordAlgorithm Algorithm { get; }
Property Value
| Type | Description |
|---|---|
| IPasswordAlgorithm |
Hash
Gets or sets the hash of the password.
Declaration
public byte[] Hash { get; }
Property Value
| Type | Description |
|---|---|
| byte[] |
Pbkdf2Algorithm
Gets the preconfigured PBKDF2 algorithm.
Declaration
public static Pbkdf2Algorithm Pbkdf2Algorithm { get; }
Property Value
| Type | Description |
|---|---|
| Pbkdf2Algorithm | The preconfigured PBKDF2 algorithm. |
Salt
Gets or sets the salt used for encryption.
Declaration
public byte[] Salt { get; }
Property Value
| Type | Description |
|---|---|
| byte[] |
Methods
Equals(object?)
Determines whether the specified object is equal to the current object.
Declaration
public override bool Equals(object? obj)
Parameters
| Type | Name | Description |
|---|---|---|
| object | obj | The object to compare with the current object. |
Returns
| Type | Description |
|---|---|
| bool | true if the specified object is equal to the current object; otherwise, false. |
Overrides
ToString()
Returns a string that represents the current object.
Declaration
public override string ToString()
Returns
| Type | Description |
|---|---|
| string | A string that represents the current object. |
Overrides
Operators
operator ==(Password, Password)
Declaration
public static bool operator ==(Password a, Password b)
Parameters
| Type | Name | Description |
|---|---|---|
| Password | a | |
| Password | b |
Returns
| Type | Description |
|---|---|
| bool |
operator !=(Password, Password)
Declaration
public static bool operator !=(Password a, Password b)
Parameters
| Type | Name | Description |
|---|---|---|
| Password | a | |
| Password | b |
Returns
| Type | Description |
|---|---|
| bool |