Record Class PasswordHashEnvelope
java.lang.Object
java.lang.Record
com.svenruppert.jsentinel.credential.password.envelope.PasswordHashEnvelope
- Record Components:
formatVersion- envelope wire formatcredentialType- alwaysCredentialType.PASSWORDin Phase 1aalgorithm- canonical algorithm identifier, e.g."PBKDF2WithHmacSHA256"providerId- logical provider identifier, e.g."pbkdf2-jdk"policyVersion- policy version recorded at encode timepepperKeyId- optional pepper key identifier; absent for the Phase-1aNoOpPepperServiceparameters- defensive copy of algorithm-specific parameter names and values (e.g.i,s)innerHash- opaque payload produced by the provider, never interpreted by the codec
public record PasswordHashEnvelope(PasswordHashFormatVersion formatVersion, CredentialType credentialType, String algorithm, String providerId, int policyVersion, Optional<String> pepperKeyId, Map<String,String> parameters, String innerHash)
extends Record
Parsed view of a self-describing password-hash envelope.
The record carries only metadata required to round-trip a stored credential back through the verification pipeline: the format and policy versions, the credential type discriminator, the algorithm and provider identifiers, the optional pepper key id, the algorithm parameters and the inner-hash payload.
This type performs no cryptographic work, no policy validation, no algorithm strength assessment and no provider resolution. Those concerns live in later Phase-1a layers.
The toString() implementation deliberately omits the
inner-hash payload and every parameter value; only the structural
skeleton is printed.
-
Constructor Summary
ConstructorsConstructorDescriptionPasswordHashEnvelope(PasswordHashFormatVersion formatVersion, CredentialType credentialType, String algorithm, String providerId, int policyVersion, Optional<String> pepperKeyId, Map<String, String> parameters, String innerHash) Creates an instance of aPasswordHashEnveloperecord class. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of thealgorithmrecord component.Returns the value of thecredentialTyperecord component.final booleanIndicates whether some other object is "equal to" this one.Returns the value of theformatVersionrecord component.final inthashCode()Returns a hash code value for this object.Returns the value of theinnerHashrecord component.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
-
PasswordHashEnvelope
public PasswordHashEnvelope(PasswordHashFormatVersion formatVersion, CredentialType credentialType, String algorithm, String providerId, int policyVersion, Optional<String> pepperKeyId, Map<String, String> parameters, String innerHash) Creates an instance of aPasswordHashEnveloperecord class.- Parameters:
formatVersion- the value for theformatVersionrecord componentcredentialType- the value for thecredentialTyperecord 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 componentinnerHash- the value for theinnerHashrecord 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. -
formatVersion
Returns the value of theformatVersionrecord component.- Returns:
- the value of the
formatVersionrecord component
-
credentialType
Returns the value of thecredentialTyperecord component.- Returns:
- the value of the
credentialTyperecord 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
-
innerHash
-