Record Class KeyEncryptionProperties

java.lang.Object
java.lang.Record
com.irurueta.authserver.authorization.infrastructure.keys.KeyEncryptionProperties
Record Components:
password - the passphrase the encryption key is derived from.
salt - the salt of the derivation, hex encoded.

public record KeyEncryptionProperties(String password, String salt) extends Record
Inputs of the encryption of private signing keys at rest.

The record never prints its values: a log line or an exception message that mentions it cannot leak them.

  • Field Details

    • password

      private final String password
      The field for the password record component.
    • salt

      private final String salt
      The field for the salt record component.
  • Constructor Details

    • KeyEncryptionProperties

      public KeyEncryptionProperties(String password, String salt)
      Validates the properties.
      Throws:
      IllegalArgumentException - if the passphrase or the salt is null or blank.
  • Method Details

    • toString

      public String toString()
      Describes the properties without revealing them.
      Specified by:
      toString in class Record
      Returns:
      a fixed text.
    • 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. All components in this record class are compared with Objects::equals(Object,Object).
      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.
    • password

      public String password()
      Returns the value of the password record component.
      Returns:
      the value of the password record component
    • salt

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