Record Class DerivedKeyMaterial
java.lang.Object
java.lang.Record
net.jrodolfo.java_evolution.java25.key_derivation.DerivedKeyMaterial
- Record Components:
algorithm- the KDF algorithm used by the examplecontextLabel- the application context used during derivationbytes- the derived key bytes
public record DerivedKeyMaterial(String algorithm, String contextLabel, byte[] bytes)
extends Record
Captures key material derived by the Java 25 KDF API.
The derived bytes are exposed for tests and learning. Production code should handle key material carefully and avoid logging or printing secrets.
-
Constructor Summary
ConstructorsConstructorDescriptionDerivedKeyMaterial(String algorithm, String contextLabel, byte[] bytes) Creates an immutable holder for derived key bytes. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of thealgorithmrecord component.intReturns the number of derived bytes.byte[]bytes()Returns the value of thebytesrecord component.Returns the value of thecontextLabelrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.hex()Formats the derived bytes for deterministic tests and documentation.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
DerivedKeyMaterial
-
-
Method Details
-
bytes
-
byteLength
public int byteLength()Returns the number of derived bytes.- Returns:
- derived key material length in bytes
-
hex
Formats the derived bytes for deterministic tests and documentation.- Returns:
- hexadecimal representation of the derived bytes
-
toString
-
hashCode
-
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). -
algorithm
-
contextLabel
Returns the value of thecontextLabelrecord component.- Returns:
- the value of the
contextLabelrecord component
-