Record Class MediaKeys

java.lang.Object
java.lang.Record
it.auties.whatsapp.model.media.MediaKeys

public record MediaKeys(byte[] mediaKey, byte[] iv, byte[] cipherKey, byte[] macKey, byte[] ref) extends Record
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    private final byte[]
    The field for the cipherKey record component.
    private static final int
     
    private final byte[]
    The field for the iv record component.
    private final byte[]
    The field for the macKey record component.
    private final byte[]
    The field for the mediaKey record component.
    private final byte[]
    The field for the ref record component.
  • Constructor Summary

    Constructors
    Constructor
    Description
    MediaKeys(byte[] mediaKey, byte[] iv, byte[] cipherKey, byte[] macKey, byte[] ref)
    Creates an instance of a MediaKeys record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    byte[]
    Returns the value of the cipherKey record component.
    final boolean
    Indicates whether some other object is "equal to" this one.
    final int
    Returns a hash code value for this object.
    byte[]
    iv()
    Returns the value of the iv record component.
    byte[]
    Returns the value of the macKey record component.
    byte[]
    Returns the value of the mediaKey record component.
    static MediaKeys
    of(byte @NonNull [] key, @NonNull String type)
     
    static MediaKeys
    random(@NonNull String type)
     
    byte[]
    ref()
    Returns the value of the ref record component.
    final String
    Returns a string representation of this record class.

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Field Details

    • mediaKey

      private final byte[] mediaKey
      The field for the mediaKey record component.
    • iv

      private final byte[] iv
      The field for the iv record component.
    • cipherKey

      private final byte[] cipherKey
      The field for the cipherKey record component.
    • macKey

      private final byte[] macKey
      The field for the macKey record component.
    • ref

      private final byte[] ref
      The field for the ref record component.
    • EXPANDED_SIZE

      private static final int EXPANDED_SIZE
      See Also:
  • Constructor Details

    • MediaKeys

      public MediaKeys(byte[] mediaKey, byte[] iv, byte[] cipherKey, byte[] macKey, byte[] ref)
      Creates an instance of a MediaKeys record class.
      Parameters:
      mediaKey - the value for the mediaKey record component
      iv - the value for the iv record component
      cipherKey - the value for the cipherKey record component
      macKey - the value for the macKey record component
      ref - the value for the ref record component
  • Method Details

    • random

      public static MediaKeys random(@NonNull @NonNull String type)
    • of

      public static MediaKeys of(byte @NonNull [] key, @NonNull @NonNull String type)
    • 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 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.
    • mediaKey

      public byte[] mediaKey()
      Returns the value of the mediaKey record component.
      Returns:
      the value of the mediaKey record component
    • iv

      public byte[] iv()
      Returns the value of the iv record component.
      Returns:
      the value of the iv record component
    • cipherKey

      public byte[] cipherKey()
      Returns the value of the cipherKey record component.
      Returns:
      the value of the cipherKey record component
    • macKey

      public byte[] macKey()
      Returns the value of the macKey record component.
      Returns:
      the value of the macKey record component
    • ref

      public byte[] ref()
      Returns the value of the ref record component.
      Returns:
      the value of the ref record component