Class PasswordHashingServices
java.lang.Object
com.svenruppert.jsentinel.credential.password.PasswordHashingServices
Wiring helpers for the Phase-1a
PasswordHashingService.
Use defaults() for production code that wants the safe
out-of-the-box configuration (OWASP-2023 PBKDF2 baseline, no pepper,
KDF limiter with the
default budget). Tests that need
tighter parameters or different limiter behaviour build the service
directly through the DefaultPasswordHashingService constructor.
-
Method Summary
Modifier and TypeMethodDescriptionstatic PasswordHashingServicedefaults()Builds a fully wired Phase-1aPasswordHashingServicefrom the JDK-only PBKDF2 provider, the reference policy, the no-op pepper service and a semaphore-backed KDF limiter using the default budget.static PasswordHashingServicedefaults(PasswordHashPolicy policy) Builds a fully wired Phase-1aPasswordHashingServicethat follows the supplied policy.static PasswordHashingServicedefaults(PasswordHashPolicy policy, KdfExecutionLimiter limiter) Builds a fully wired Phase-1aPasswordHashingServicewith a caller-supplied policy and KDF limiter.static PasswordHashingServicedefaults(PasswordHashPolicy policy, KdfExecutionLimiter limiter, PepperService pepperService) Builds a fully wired Phase-1aPasswordHashingServicewith a caller-supplied policy, KDF limiter andPepperService.
-
Method Details
-
defaults
Builds a fully wired Phase-1aPasswordHashingServicefrom the JDK-only PBKDF2 provider, the reference policy, the no-op pepper service and a semaphore-backed KDF limiter using the default budget. -
defaults
Builds a fully wired Phase-1aPasswordHashingServicethat follows the supplied policy. The policy must listPBKDF2WithHmacSHA256/pbkdf2-jdkas the preferred algorithm and provider (Phase 1a ships only the JDK provider). -
defaults
public static PasswordHashingService defaults(PasswordHashPolicy policy, KdfExecutionLimiter limiter) Builds a fully wired Phase-1aPasswordHashingServicewith a caller-supplied policy and KDF limiter. Mostly useful for tests that want aNoLimitKdfExecutionLimiteror a tight budget. -
defaults
public static PasswordHashingService defaults(PasswordHashPolicy policy, KdfExecutionLimiter limiter, PepperService pepperService) Builds a fully wired Phase-1aPasswordHashingServicewith a caller-supplied policy, KDF limiter andPepperService.Pass an
InMemoryPepperService(or any production-grade implementation) to enable post-KDF HMAC peppering.NoOpPepperService.INSTANCEdisables peppering altogether — equivalent to the older two-argument overload.
-