CapyKit/Documentation/Help/M_CapyKit_Helpers_SecurityHelper_GetPassword__1.md

2.3 KiB

GetPassword<T>(String, Byte[], Object[]) Method

Retrieves a Password object using the specified password, salt, and optional constructor arguments.

Definition

Namespace: CapyKit.Helpers
Assembly: CapyKit (in CapyKit.dll) Version: 1.0.0

C#

public static Password GetPassword<T>(
	string password,
	byte[] salt,
	params Object[] args
)
where T : IPasswordAlgorithm

F#

static member GetPassword : 
        password : string * 
        salt : byte[] * 
        args : Object[] -> Password  when 'T : IPasswordAlgorithm

Parameters

  String
The plaintext password to be hashed.
  Byte[]
A random value used as an additional input to the one-way function that hashes data, a password or passphrase. This is used to make each output different for the same input thus adding security.
  Object[]
Optional constructor arguments for the IPasswordAlgorithm implementation instance.

Type Parameters

The type of IPasswordAlgorithm implementation to use.

Return Value

Password
A new Password object with the given password and salt, as well as an instance of T created using the provided constructor arguments.

Remarks

This method uses reflection to find a constructor for the specified password algorithm type (T). It emits an error event if a suitable constructor is not found or if there is an error invoking the constructor.

See Also

Reference

SecurityHelper Class
GetPassword Overload
CapyKit.Helpers Namespace