Class Password

Namespace: CapyKit
Assembly: CapyKit.dll

Represents a password with its hash, salt and algorithm used for encryption.

public class Password

Inheritance

objectPassword

Inherited Members

object.Equals(object?), object.Equals(object?, object?), object.GetHashCode(), object.GetType(), object.MemberwiseClone(), object.ReferenceEquals(object?, object?), object.ToString()

Extension Methods

ObjectExtensions.UpdateProperties<Password>(Password, Password), ObjectExtensions.UpdateProperties(object, object)

Constructors

Password(string, byte[], IPasswordAlgorithm, params object[])

Constructor.

public Password(string password, byte[] salt, IPasswordAlgorithm algorithm, params object[] args)

Parameters

password string

The password to be hashed.

salt byte[]

The salt used for encryption.

algorithm IPasswordAlgorithm

The algorithm used for password encryption.

args object[]

A variable-length parameters list containing arguments to include for the algorithm.

Properties

Algorithm

Gets or sets the algorithm used for password encryption.

public IPasswordAlgorithm Algorithm { get; }

Property Value

IPasswordAlgorithm

Hash

Gets or sets the hash of the password.

public byte[] Hash { get; }

Property Value

byte[]

Pbkdf2Algorithm

Gets the preconfigured PBKDF2 algorithm.

public static Pbkdf2Algorithm Pbkdf2Algorithm { get; }

Property Value

Pbkdf2Algorithm

Salt

Gets or sets the salt used for encryption.

public byte[] Salt { get; }

Property Value

byte[]

Methods

Equals(object?)

Determines whether the specified object is equal to the current object.

public override bool Equals(object? obj)

Parameters

obj object?

The object to compare with the current object.

Returns

bool

true if the specified object is equal to the current object; otherwise, false.

ToString()

Returns a string that represents the current object.

public override string ToString()

Returns

string

A string that represents the current object.

Operators

operator ==(Password, Password)

public static bool operator ==(Password a, Password b)

Parameters

a Password

b Password

Returns

bool

operator !=(Password, Password)

public static bool operator !=(Password a, Password b)

Parameters

a Password

b Password

Returns

bool