Package codes.grow.packages.vault
Record Class DataKey
java.lang.Object
java.lang.Record
codes.grow.packages.vault.DataKey
- Record Components:
ciphertext- the data key encrypted with the transit keykeyVersion- transit key version usedplaintext- the data key bytes (only for theplaintextvariant)
A data key generated by transit (
transit/datakey/<plaintext|wrapped>/<name>). The
plaintext is never printed.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of theciphertextrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.intReturns the value of thekeyVersionrecord component.Optional<byte[]> Returns the value of theplaintextrecord component.toString()Returns a string representation of this record class.
-
Constructor Details
-
DataKey
Creates an instance of aDataKeyrecord class.- Parameters:
ciphertext- the value for theciphertextrecord componentkeyVersion- the value for thekeyVersionrecord componentplaintext- the value for theplaintextrecord component
-
-
Method Details
-
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. -
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. -
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. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with '=='. -
ciphertext
Returns the value of theciphertextrecord component.- Returns:
- the value of the
ciphertextrecord component
-
keyVersion
public int keyVersion()Returns the value of thekeyVersionrecord component.- Returns:
- the value of the
keyVersionrecord component
-
plaintext
Returns the value of theplaintextrecord component.- Returns:
- the value of the
plaintextrecord component
-