vertx / io.vertx.ext.auth.mongo / HashStrategy

HashStrategy

interface HashStrategy

Determines how the hashing is computed in the implementation You can implement this to provide a different hashing strategy to the default.

Author
mremme

Functions

computeHash

abstract fun computeHash(password: String, user: User): String

Compute the hashed password given the unhashed password and the user

getSalt

abstract fun getSalt(user: User): String

Retrieve the salt. The source of the salt can be the external salt or the propriate column of the given user, depending on the defined HashSaltStyle

getSaltStyle

abstract fun getSaltStyle(): HashSaltStyle

Get the defined HashSaltStyle of the current instance

getStoredPwd

abstract fun getStoredPwd(user: User): String

Retrieve the password from the user, or as clear text or as hashed version, depending on the definition

setExternalSalt

abstract fun setExternalSalt(salt: String): Unit

Set an external salt. This method should be used in case of HashSaltStyle#EXTERNAL

setSaltStyle

abstract fun setSaltStyle(saltStyle: HashSaltStyle): Unit

Set the saltstyle as defined by HashSaltStyle.