Interface PasswordHashingService
- All Known Implementing Classes:
DefaultPasswordHashingService
public interface PasswordHashingService
Front-door facade for the Phase-1a password hashing and verification
pipeline.
The pipeline order is fixed:
parse -> validate -> resolveProvider -> resolvePepper
-> verify -> rehashDecision
verify(char[], String) returns only
CredentialVerificationResult; the boolean shape of the
experimental API is intentionally gone (see CWE-287, CWE-203).
needsRehash(String) is callable after a successful verify
(or independently) to drive transparent upgrades against a
compare-and-swap credential store.
-
Method Summary
Modifier and TypeMethodDescriptionhash(char[] password) Produces a fresh hash for the given password under the active policy.default PasswordHashResulthash(SecretValue password) SecretValue overload forhash(char[]).needsRehash(String encodedHash) Reports whether the supplied envelope should be rehashed under the active policy.Runs the verification pipeline on the supplied envelope.default CredentialVerificationResultverify(SecretValue password, String encodedHash) SecretValue overload forverify(char[], String).verifyAgainstNothing(char[] password) Convenience entry point for callers that already know there is no stored envelope to verify against (typically "unknown user" paths).default CredentialVerificationResultverifyAgainstNothing(SecretValue password) SecretValue overload forverifyAgainstNothing(char[]).
-
Method Details
-
hash
Produces a fresh hash for the given password under the active policy.- Parameters:
password- caller-owned character buffer; the implementation must not modify or zero it
-
verify
Runs the verification pipeline on the supplied envelope. -
needsRehash
Reports whether the supplied envelope should be rehashed under the active policy. -
verifyAgainstNothing
Convenience entry point for callers that already know there is no stored envelope to verify against (typically "unknown user" paths). The implementation still performs a comparable KDF call so the response is not distinguishable from a real verification (CWE-203, CWE-208). -
hash
SecretValue overload forhash(char[]). The borrowedchar[]copy returned bySecretValue.asChars()is zeroed in afinallyblock (CWE-226). -
verify
SecretValue overload forverify(char[], String). -
verifyAgainstNothing
SecretValue overload forverifyAgainstNothing(char[]).
-