Record Class PasswordHashResult
java.lang.Object
java.lang.Record
com.svenruppert.jsentinel.credential.password.PasswordHashResult
- Record Components:
encodedHash- self-describing envelope, nevernullor blankcredentialType- credential discriminator, alwaysCredentialType.PASSWORDin Phase 1aformatVersion- envelope format version that produced this resultalgorithm- canonical algorithm identifier, e.g."PBKDF2WithHmacSHA256"providerId- logical provider identifier, e.g."pbkdf2-jdk"policyVersion- policy version in force when the hash was producedpepperKeyId- optional pepper-key identifier; absent for the Phase-1aNoOpPepperServiceparameters- defensive copy of the algorithm parameters that were applied (e.g. iteration count, salt length); nevernull, may be empty
public record PasswordHashResult(String encodedHash, CredentialType credentialType, int formatVersion, String algorithm, String providerId, int policyVersion, Optional<String> pepperKeyId, Map<String,String> parameters)
extends Record
Immutable result of a password-hashing operation.
Carries everything required to round-trip the produced credential back through the verification pipeline without further policy lookups: the encoded envelope plus the discriminating metadata that was used to build it.
The toString() implementation never exposes
encodedHash() or any KDF parameter values; only the
non-sensitive shape is printed. The encoded envelope itself contains
salt and inner hash material and must be treated as a credential
derivative.
-
Constructor Summary
ConstructorsConstructorDescriptionPasswordHashResult(String encodedHash, CredentialType credentialType, int formatVersion, String algorithm, String providerId, int policyVersion, Optional<String> pepperKeyId, Map<String, String> parameters) Creates an instance of aPasswordHashResultrecord class. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of thealgorithmrecord component.Returns the value of thecredentialTyperecord component.Returns the value of theencodedHashrecord component.final booleanIndicates whether some other object is "equal to" this one.intReturns the value of theformatVersionrecord component.final inthashCode()Returns a hash code value for this object.Returns the value of theparametersrecord component.Returns the value of thepepperKeyIdrecord component.intReturns the value of thepolicyVersionrecord component.Returns the value of theproviderIdrecord component.toString()Returns a string representation of this record class.
-
Constructor Details
-
PasswordHashResult
public PasswordHashResult(String encodedHash, CredentialType credentialType, int formatVersion, String algorithm, String providerId, int policyVersion, Optional<String> pepperKeyId, Map<String, String> parameters) Creates an instance of aPasswordHashResultrecord class.- Parameters:
encodedHash- the value for theencodedHashrecord componentcredentialType- the value for thecredentialTyperecord componentformatVersion- the value for theformatVersionrecord componentalgorithm- the value for thealgorithmrecord componentproviderId- the value for theproviderIdrecord componentpolicyVersion- the value for thepolicyVersionrecord componentpepperKeyId- the value for thepepperKeyIdrecord componentparameters- the value for theparametersrecord component
-
-
Method Details
-
toString
-
hashCode
-
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with thecomparemethod from their corresponding wrapper classes. -
encodedHash
Returns the value of theencodedHashrecord component.- Returns:
- the value of the
encodedHashrecord component
-
credentialType
Returns the value of thecredentialTyperecord component.- Returns:
- the value of the
credentialTyperecord component
-
formatVersion
public int formatVersion()Returns the value of theformatVersionrecord component.- Returns:
- the value of the
formatVersionrecord component
-
algorithm
-
providerId
Returns the value of theproviderIdrecord component.- Returns:
- the value of the
providerIdrecord component
-
policyVersion
public int policyVersion()Returns the value of thepolicyVersionrecord component.- Returns:
- the value of the
policyVersionrecord component
-
pepperKeyId
Returns the value of thepepperKeyIdrecord component.- Returns:
- the value of the
pepperKeyIdrecord component
-
parameters
Returns the value of theparametersrecord component.- Returns:
- the value of the
parametersrecord component
-