Password

Field: MAX_LENGTH

The maximum text length that the class can contain. It is also the upper limit of the SecureString class.


Method: Password Parse(String)

After you take the value explicitly and do the checks, encrypt it and create the Password object . The password object that holds the given value in encrypted form is returned. The returned object is decrypted(IsPlain).

Parameter Name Description
passwordString The pasword is the resolved form. It can not be null. The default value is returned if a value (string.IsNullOrWhiteSpace) is given that is either blank or empty.

Error Type: ArgumentNullException (This error is thrown if the value is set to null.)

Error Type: FormatException (This error is thrown if the value is longer than MAX_LENGTH .)


Method: Password FromHash(Binary)

The hashed data allows you to create a password object.

The Password object is created with this method when it is read from the database.

The password object that holds the hashed value is returned. The returned object is hashed (IsHashed).

Parameter Name Description
passwordHash Hash value.

Property: IsPlain

Indicates that the record is encrypted by symmetric key in memory. Returns true if the object was created with the Parse method or the SecureString field constructor.


Property: IsHashed

Indicates that the fetch has been stored in memory with hash. Returns true if the object was created using the FromHash method.


Property: IsEmpty

Default value. Can be obtained with default(Password)


Constructor(SecureString)

Converts the given value to the Password object. Creates a plain object (IsPlain).

Parameter Name Description
secureString SecureString object containing the password.

Property: Value

if the value is hashed, it returns the base64 state of the hash'ed data, and if the value is plain, it returns the decrypted password.


Method: string ToString()

if the value is hashed, it returns the base64 state of the hash'ed data, and if the value is plain, it returns the decrypted password.


Method: bool Equals(Object)

Returns true if the given object has the same value as the Password object and the data, false otherwise.

Parameter Name Description
obj Object to be compared

Method: bool Equals(Password)

Returns true if the given Password object has the same value as the data, false otherwise.

Parameter Name Description
other The object of type Password to be compared