Record Class PepperReference
java.lang.Object
java.lang.Record
com.svenruppert.jsentinel.credential.password.pepper.PepperReference
- Record Components:
keyId- stable identifier; written into the envelopekey- pepper material; minimum 32 bytes for HMAC-SHA-256
Resolved pepper material handed to a
PasswordHashProvider.
Carries the stable keyId (recorded in the envelope so the
verifier can resolve the same key) plus a defensive copy of the
pepper bytes themselves. The byte array is owned by this record; do
not mutate it.
toString() never exposes the key material (CWE-209 /
CWE-522).
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intMinimum key length expected for HMAC-SHA-256 (256-bit). -
Constructor Summary
ConstructorsConstructorDescriptionPepperReference(String keyId, byte[] key) Creates an instance of aPepperReferencerecord class. -
Method Summary
Modifier and TypeMethodDescriptionbyte[]copyKey()Returns a fresh copy of the key bytes.booleanIndicates whether some other object is "equal to" this one.inthashCode()Returns a hash code value for this object.byte[]key()Returns the value of thekeyrecord component.keyId()Returns the value of thekeyIdrecord component.toString()Returns a string representation of this record class.
-
Field Details
-
MIN_KEY_BYTES
public static final int MIN_KEY_BYTESMinimum key length expected for HMAC-SHA-256 (256-bit).- See Also:
-
-
Constructor Details
-
PepperReference
-
-
Method Details
-
copyKey
public byte[] copyKey()Returns a fresh copy of the key bytes. The internal array stays untouched. -
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. All components in this record class are compared withObjects::equals(Object,Object). -
hashCode
-
toString
-
keyId
-
key
-