Table of Contents

Class Secret

Namespace
Ecng.Security
Assembly
Ecng.Security.dll

Secret.

public class Secret : Equatable<Secret>, ICloneable<Secret>, ICloneable, IEquatable<Secret>, IComparable<Secret>, IComparable
Inheritance
Secret
Implements
Inherited Members
Extension Methods

Constructors

Secret()

Initializes a new instance of the Secret class.

public Secret()

Secret(byte[], byte[], CryptoAlgorithm)

Initializes a new instance of the Secret class.

public Secret(byte[] passwordBytes, byte[] salt, CryptoAlgorithm algo = null)

Parameters

passwordBytes byte[]
salt byte[]

The salt.

algo CryptoAlgorithm

Hash algorithm. Can be null.

Fields

DefaultSaltSize

The default salt size.

public const int DefaultSaltSize = 128

Field Value

int

Properties

Algo

Gets the hash algorithm.

public CryptoAlgorithm Algo { get; }

Property Value

CryptoAlgorithm

Hash

Gets or sets the hash.

public byte[] Hash { get; set; }

Property Value

byte[]

The hash.

Salt

Gets or sets the salt.

public byte[] Salt { get; set; }

Property Value

byte[]

The salt.

Methods

Clone()

Creates a new object that is a copy of the current instance.

public override Secret Clone()

Returns

Secret

A new object that is a copy of this instance.

GetHashCode()

Serves as the default hash function.

public override int GetHashCode()

Returns

int

A hash code for the current object.

OnEquals(Secret)

Determines equality between this instance and another instance of the same type.

protected override bool OnEquals(Secret other)

Parameters

other Secret

An object to compare with this instance.

Returns

bool

true if the objects are equal; otherwise, false.