docs/api/exposed-crypt/org.jetbrains.exposed.v1.crypt/-password-encoder-hasher/index.html
open class PasswordEncoderHasher(passwordEncoder: PasswordEncoder) : Hasher
Hasher that delegates to a Spring Security passwordEncoder.
This is the base of BCryptHasher, Argon2Hasher, Pbkdf2Hasher, and SCryptHasher, and can also be used directly with any other implementation, including a DelegatingPasswordEncoder for a column whose existing values were hashed by an algorithm that is being migrated away from:
val hasher = PasswordEncoderHasher( DelegatingPasswordEncoder( "argon2", mapOf("argon2" to Argon2PasswordEncoder(...), "bcrypt" to BCryptPasswordEncoder()) ))
Content copied to clipboard
To hash with something that is not a PasswordEncoder at all, implement Hasher directly.
Members
Link copied to clipboard
constructor(passwordEncoder: PasswordEncoder)
Link copied to clipboard
open override fun hash(plainText: String): Hashed
Hashes plainText into the value to be stored, salting it if the algorithm supports salting.
Link copied to clipboard
open override fun matches(plainText: String, encodedValue: String): Boolean
Returns whether plainText hashes to encodedValue, which is expected to be an already hashed value.
Generated by Dokka © 2026 Copyright