Record Class CredentialVerificationResult.Verified

java.lang.Object
java.lang.Record
com.svenruppert.jsentinel.credential.password.CredentialVerificationResult.Verified
Record Components:
originalEncodedHash - the encoded envelope that was just verified; required as the compare-and-swap witness for any rehash
credentialType - credential discriminator
algorithm - algorithm of the verified envelope
providerId - provider identifier of the verified envelope
formatVersion - envelope format version of the verified envelope
policyVersion - policy version recorded in the envelope
pepperKeyId - pepper key id recorded in the envelope, if any
All Implemented Interfaces:
CredentialVerificationResult
Enclosing interface:
CredentialVerificationResult

public static record CredentialVerificationResult.Verified(String originalEncodedHash, CredentialType credentialType, String algorithm, String providerId, int formatVersion, int policyVersion, Optional<String> pepperKeyId) extends Record implements CredentialVerificationResult
Successful verification. Carries every piece of metadata the caller needs to decide whether to perform a transparent rehash and to do so atomically against the credential store.
  • Constructor Details

    • Verified

      public Verified(String originalEncodedHash, CredentialType credentialType, String algorithm, String providerId, int formatVersion, int policyVersion, Optional<String> pepperKeyId)
      Creates an instance of a Verified record class.
      Parameters:
      originalEncodedHash - the value for the originalEncodedHash record component
      credentialType - the value for the credentialType record component
      algorithm - the value for the algorithm record component
      providerId - the value for the providerId record component
      formatVersion - the value for the formatVersion record component
      policyVersion - the value for the policyVersion record component
      pepperKeyId - the value for the pepperKeyId record component
  • 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.
    • originalEncodedHash

      public String originalEncodedHash()
      Returns the value of the originalEncodedHash record component.
      Returns:
      the value of the originalEncodedHash 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
    • formatVersion

      public int formatVersion()
      Returns the value of the formatVersion record component.
      Returns:
      the value of the formatVersion 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