Record Class Ciphersuite

java.lang.Object
java.lang.Record
com.yahoo.security.hpke.Ciphersuite

public record Ciphersuite(Kem kem, Kdf kdf, Aead aead) extends Record
A Ciphersuite is a 3-tuple that encapsulates the necessary primitives to use HKDF:
  • A key encapsulation mechanism (KEM)
  • A key derivation function (KDF)
  • An "authenticated encryption with associated data" (AEAD) algorithm
Author:
vekterli
  • Constructor Summary

    Constructors
    Constructor
    Description
    Ciphersuite(Kem kem, Kdf kdf, Aead aead)
    Creates an instance of a Ciphersuite record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    Returns the value of the aead record component.
    Returns a Ciphersuite of DHKEM(X25519, HKDF-SHA256), HKDF-SHA256, AES-128-GCM
    final boolean
    Indicates whether some other object is "equal to" this one.
    final int
    Returns a hash code value for this object.
    kdf()
    Returns the value of the kdf record component.
    kem()
    Returns the value of the kem record component.
    of(Kem kem, Kdf kdf, Aead aead)
     
    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
  • Constructor Details

    • Ciphersuite

      public Ciphersuite(Kem kem, Kdf kdf, Aead aead)
      Creates an instance of a Ciphersuite record class.
      Parameters:
      kem - the value for the kem record component
      kdf - the value for the kdf record component
      aead - the value for the aead record component
  • Method Details

    • of

      public static Ciphersuite of(Kem kem, Kdf kdf, Aead aead)
    • defaultSuite

      public static Ciphersuite defaultSuite()
      Returns a Ciphersuite of DHKEM(X25519, HKDF-SHA256), HKDF-SHA256, AES-128-GCM
    • 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.
    • kem

      public Kem kem()
      Returns the value of the kem record component.
      Returns:
      the value of the kem record component
    • kdf

      public Kdf kdf()
      Returns the value of the kdf record component.
      Returns:
      the value of the kdf record component
    • aead

      public Aead aead()
      Returns the value of the aead record component.
      Returns:
      the value of the aead record component