Record Class PasswordHashEnvelope

java.lang.Object
java.lang.Record
com.svenruppert.jsentinel.credential.password.envelope.PasswordHashEnvelope
Record Components:
formatVersion - envelope wire format
credentialType - always CredentialType.PASSWORD in Phase 1a
algorithm - canonical algorithm identifier, e.g. "PBKDF2WithHmacSHA256"
providerId - logical provider identifier, e.g. "pbkdf2-jdk"
policyVersion - policy version recorded at encode time
pepperKeyId - optional pepper key identifier; absent for the Phase-1a NoOpPepperService
parameters - 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 Details

  • Method Details

    • toString

      public String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      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 with Objects::equals(Object,Object); primitive components are compared with the compare method from their corresponding wrapper classes.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • formatVersion

      public PasswordHashFormatVersion formatVersion()
      Returns the value of the formatVersion record component.
      Returns:
      the value of the formatVersion record component
    • credentialType

      public CredentialType credentialType()
      Returns the value of the credentialType record component.
      Returns:
      the value of the credentialType record component
    • algorithm

      public String algorithm()
      Returns the value of the algorithm record component.
      Returns:
      the value of the algorithm record component
    • providerId

      public String providerId()
      Returns the value of the providerId record component.
      Returns:
      the value of the providerId record component
    • policyVersion

      public int policyVersion()
      Returns the value of the policyVersion record component.
      Returns:
      the value of the policyVersion record component
    • pepperKeyId

      public Optional<String> pepperKeyId()
      Returns the value of the pepperKeyId record component.
      Returns:
      the value of the pepperKeyId record component
    • parameters

      public Map<String,String> parameters()
      Returns the value of the parameters record component.
      Returns:
      the value of the parameters record component
    • innerHash

      public String innerHash()
      Returns the value of the innerHash record component.
      Returns:
      the value of the innerHash record component