Record Class KeyringProtection

java.lang.Object
java.lang.Record
zeroecho.core.storage.KeyringProtection
Record Components:
operationalIterationMaximum - maximum accepted PBKDF2 iteration count; it may restrict but never exceed the absolute decoded maximum

public record KeyringProtection(int operationalIterationMaximum) extends Record
Operational limits applied while opening an encrypted software keyring.
  • Field Details

    • CREATION_ITERATIONS

      public static final int CREATION_ITERATIONS
      Iterations used when a new keyring is created.
      See Also:
    • MAX_OPERATIONAL_ITERATIONS

      public static final int MAX_OPERATIONAL_ITERATIONS
      Largest operationally accepted PBKDF2 iteration count.
      See Also:
    • MAX_DECODED_ITERATIONS

      public static final int MAX_DECODED_ITERATIONS
      Absolute safety ceiling for decoded PBKDF2 iteration counts.
      See Also:
  • Constructor Details

    • KeyringProtection

      public KeyringProtection(int operationalIterationMaximum)
      Validates the operational limit.
      Throws:
      IllegalArgumentException - if the limit is below the creation setting or above the absolute operational maximum
  • Method Details

    • standard

      public static KeyringProtection standard()
      Returns the standard protection policy.
      Returns:
      policy accepting up to one million iterations
    • toString

      public final 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. All components in this record class 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.
    • operationalIterationMaximum

      public int operationalIterationMaximum()
      Returns the value of the operationalIterationMaximum record component.
      Returns:
      the value of the operationalIterationMaximum record component