Record Class Recipient

java.lang.Object
java.lang.Record
co.cryptoservice.sdk.Recipient
Record Components:
publicKey - the public key as hex
type - the recipient type
mlKemPublicKey - the ML-KEM public key as hex

public record Recipient(String publicKey, RecipientType type, String mlKemPublicKey) extends Record
One element of recipients.
  • Constructor Details

  • Method Details

    • of

      public static Recipient of(String publicKey, RecipientType type)
      A request with only the required members; the optional ones are null.
      Parameters:
      publicKey - the public key as hex
      type - the recipient type
      Returns:
      the request
    • withMlKemPublicKey

      public Recipient withMlKemPublicKey(String mlKemPublicKey)
      A copy with mlKemPublicKey replaced.
      Parameters:
      mlKemPublicKey - the ML-KEM public key as hex
      Returns:
      the new request
    • toString

      public String toString()
      Names the members; values that may be secret (keys, plaintexts, passwords, signatures) are redacted.
      Specified by:
      toString in class Record
      Returns:
      a description safe to log
    • 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.
    • publicKey

      public String publicKey()
      Returns the value of the publicKey record component.
      Returns:
      the value of the publicKey record component
    • type

      public RecipientType type()
      Returns the value of the type record component.
      Returns:
      the value of the type record component
    • mlKemPublicKey

      public String mlKemPublicKey()
      Returns the value of the mlKemPublicKey record component.
      Returns:
      the value of the mlKemPublicKey record component