Class DefaultPasswordHashPolicy
java.lang.Object
com.svenruppert.jsentinel.credential.password.policy.DefaultPasswordHashPolicy
- All Implemented Interfaces:
PasswordHashPolicy
Reference
PasswordHashPolicy backed by explicit, immutable
maps. Use builder() to assemble a policy programmatically.
The class deliberately does not provide a "load from properties" facility in Phase 1a: policies live in code so they participate in type checking and tests.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classMutable assembler. -
Method Summary
Modifier and TypeMethodDescriptionAlgorithm identifiers that are still accepted by this policy.Provider identifiers that are still accepted by this policy.builder()defaultParameters(String algorithm) Default parameters the policy emits when producing a fresh hash with the given algorithm.booleanisAlgorithmAcceptable(String algorithm) Returns whether the given algorithm is acceptable for verification under this policy.booleanisProviderAcceptable(String providerId) Returns whether the given provider identifier is acceptable for verification under this policy.maximumParameters(String algorithm) Upper bound for each parameter value.minimumParameters(String algorithm) Lower bound for each parameter value.intMonotonically increasing version of this policy.Algorithm identifier the policy emits for new hashes.Envelope wire format the policy emits for new hashes.Provider identifier the policy emits for new hashes.Envelope format versions the operator has explicitly rejected.Policy versions the operator has explicitly rejected.
-
Method Details
-
policyVersion
public int policyVersion()Description copied from interface:PasswordHashPolicyMonotonically increasing version of this policy. Stored in every envelope. A mismatch between the active policy version and the version embedded in an envelope is one of the triggers for aPOLICY_VERSION_OUTDATEDrehash.- Specified by:
policyVersionin interfacePasswordHashPolicy
-
preferredFormatVersion
Description copied from interface:PasswordHashPolicyEnvelope wire format the policy emits for new hashes. Older known format versions remain readable but may be flagged for rehash.- Specified by:
preferredFormatVersionin interfacePasswordHashPolicy
-
preferredAlgorithm
Description copied from interface:PasswordHashPolicyAlgorithm identifier the policy emits for new hashes.- Specified by:
preferredAlgorithmin interfacePasswordHashPolicy
-
preferredProviderId
Description copied from interface:PasswordHashPolicyProvider identifier the policy emits for new hashes.- Specified by:
preferredProviderIdin interfacePasswordHashPolicy
-
acceptableAlgorithms
Description copied from interface:PasswordHashPolicyAlgorithm identifiers that are still accepted by this policy. The preferred algorithm is always part of this set.- Specified by:
acceptableAlgorithmsin interfacePasswordHashPolicy
-
acceptableProviderIds
Description copied from interface:PasswordHashPolicyProvider identifiers that are still accepted by this policy. The preferred provider is always part of this set.- Specified by:
acceptableProviderIdsin interfacePasswordHashPolicy
-
isAlgorithmAcceptable
Description copied from interface:PasswordHashPolicyReturns whether the given algorithm is acceptable for verification under this policy.- Specified by:
isAlgorithmAcceptablein interfacePasswordHashPolicy
-
isProviderAcceptable
Description copied from interface:PasswordHashPolicyReturns whether the given provider identifier is acceptable for verification under this policy.- Specified by:
isProviderAcceptablein interfacePasswordHashPolicy
-
defaultParameters
Description copied from interface:PasswordHashPolicyDefault parameters the policy emits when producing a fresh hash with the given algorithm.- Specified by:
defaultParametersin interfacePasswordHashPolicy
-
minimumParameters
Description copied from interface:PasswordHashPolicyLower bound for each parameter value. Validation rejects envelopes whose parameters fall below these values.- Specified by:
minimumParametersin interfacePasswordHashPolicy
-
rejectedFormatVersions
Description copied from interface:PasswordHashPolicyEnvelope format versions the operator has explicitly rejected. Envelopes whoseformatVersionappears here fail validation outright; older versions that are not in this set remain verifiable and are flagged for rehash by the rehash engine.Default: empty (no formats explicitly rejected).
- Specified by:
rejectedFormatVersionsin interfacePasswordHashPolicy
-
rejectedPolicyVersions
Description copied from interface:PasswordHashPolicyPolicy versions the operator has explicitly rejected. Envelopes whosepolicyVersionappears here fail validation outright; older versions that are not in this set remain verifiable (and are flagged for rehash if they are below the active policy version).Default: empty (no policy versions explicitly rejected).
- Specified by:
rejectedPolicyVersionsin interfacePasswordHashPolicy
-
maximumParameters
Description copied from interface:PasswordHashPolicyUpper bound for each parameter value. Validation rejects envelopes whose parameters exceed these values; this is the primary defence against parameter-driven resource exhaustion (CWE-400).- Specified by:
maximumParametersin interfacePasswordHashPolicy
-
builder
-