C# 클래스 TShockAPI.DB.User

A database user.
파일 보기 프로젝트 열기: NyxStudios/TShock 1 사용 예제들

보호된 프로퍼티들

프로퍼티 타입 설명
HashTypes Func>.Dictionary

공개 메소드들

메소드 설명
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.

보호된 메소드들

메소드 설명
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.

메소드 상세

CreateBCryptHash() 공개 메소드

Creates a BCrypt hash for a user and stores it in this object.
public CreateBCryptHash ( string password ) : void
password string The plain text password to hash
리턴 void

CreateBCryptHash() 공개 메소드

Creates a BCrypt hash for a user and stores it in this object.
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
리턴 void

HashPassword() 보호된 메소드

Returns a hashed string for a given string based on the config file's hash algo
protected HashPassword ( byte bytes ) : string
bytes byte bytes to hash
리턴 string

HashPassword() 보호된 메소드

Returns a hashed string for a given string based on the config file's hash algo
protected HashPassword ( string password ) : string
password string string to hash
리턴 string

UpgradePasswordToBCrypt() 보호된 메소드

Upgrades a password to BCrypt, from an insecure hashing algorithm.
protected UpgradePasswordToBCrypt ( string password ) : void
password string The raw user password (unhashed) to upgrade
리턴 void

UpgradePasswordWorkFactor() 보호된 메소드

Upgrades a password to the highest work factor available in the config.
protected UpgradePasswordWorkFactor ( string password ) : void
password string The raw user password (unhashed) to upgrade
리턴 void

User() 공개 메소드

Default constructor for a user object; holds no data.
public User ( ) : System
리턴 System

User() 공개 메소드

Constructor for the user object, assuming you define everything yourself.
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
리턴 System

VerifyPassword() 공개 메소드

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.
public VerifyPassword ( string password ) : bool
password string The password to check against the user object.
리턴 bool

프로퍼티 상세

HashTypes 보호되어 있는 프로퍼티

A dictionary of hashing algorithms and an implementation object.
protected Dictionary> HashTypes
리턴 Func>.Dictionary