Property | Type | Description | |
---|---|---|---|
HashTypes | Func |
Method | Description | |
---|---|---|
CreateBCryptHash ( string password ) : void |
Creates a BCrypt hash for a user and stores it in this object.
|
|
CreateBCryptHash ( string password, int workFactor ) : void |
Creates a BCrypt hash for a user and stores it in this object.
|
|
User ( ) : System |
Default constructor for a user object; holds no data.
|
|
User ( string name, string pass, string uuid, string group, string registered, string last, string known ) : System |
Constructor for the user object, assuming you define everything yourself.
|
|
VerifyPassword ( string password ) : bool |
Verifies if a password matches the one stored in the database. If the password is stored in an unsafe hashing algorithm, it will be converted to BCrypt. If the password is stored using BCrypt, it will be re-saved if the work factor in the config is greater than the existing work factor with the new work factor.
|
Method | Description | |
---|---|---|
HashPassword ( byte bytes ) : string |
Returns a hashed string for a given string based on the config file's hash algo
|
|
HashPassword ( string password ) : string |
Returns a hashed string for a given string based on the config file's hash algo
|
|
UpgradePasswordToBCrypt ( string password ) : void |
Upgrades a password to BCrypt, from an insecure hashing algorithm.
|
|
UpgradePasswordWorkFactor ( string password ) : void |
Upgrades a password to the highest work factor available in the config.
|
public CreateBCryptHash ( string password ) : void | ||
password | string | The plain text password to hash |
return | void |
public CreateBCryptHash ( string password, int workFactor ) : void | ||
password | string | The plain text password to hash |
workFactor | int | The work factor to use in generating the password hash |
return | void |
protected HashPassword ( byte bytes ) : string | ||
bytes | byte | bytes to hash |
return | string |
protected HashPassword ( string password ) : string | ||
password | string | string to hash |
return | string |
protected UpgradePasswordToBCrypt ( string password ) : void | ||
password | string | The raw user password (unhashed) to upgrade |
return | void |
protected UpgradePasswordWorkFactor ( string password ) : void | ||
password | string | The raw user password (unhashed) to upgrade |
return | void |
public User ( string name, string pass, string uuid, string group, string registered, string last, string known ) : System | ||
name | string | The user's name. |
pass | string | The user's password hash. |
uuid | string | The user's UUID. |
group | string | The user's group name. |
registered | string | The unix epoch for the registration date. |
last | string | The unix epoch for the last access date. |
known | string | The known IPs for the user, serialized as a JSON object |
return | System |
public VerifyPassword ( string password ) : bool | ||
password | string | The password to check against the user object. |
return | bool |