Record Class KeyMetadata

java.lang.Object
java.lang.Record
co.cryptoservice.sdk.KeyMetadata
Record Components:
exp - the expiry, or null
kid - the key identifier
use - sig or enc, or null

public record KeyMetadata(String exp, String kid, String use) extends Record
The metadata member.
  • Constructor Details

    • KeyMetadata

      public KeyMetadata(String exp, String kid, String use)
      Creates an instance of a KeyMetadata record class.
      Parameters:
      exp - the value for the exp record component
      kid - the value for the kid record component
      use - the value for the use record component
  • Method Details

    • withExp

      public KeyMetadata withExp(String exp)
      A copy with exp replaced.
      Parameters:
      exp - the expiry, or null
      Returns:
      the new request
    • withKid

      public KeyMetadata withKid(String kid)
      A copy with kid replaced.
      Parameters:
      kid - the key identifier
      Returns:
      the new request
    • withUse

      public KeyMetadata withUse(String use)
      A copy with use replaced.
      Parameters:
      use - sig or enc, or null
      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.
    • exp

      public String exp()
      Returns the value of the exp record component.
      Returns:
      the value of the exp record component
    • kid

      public String kid()
      Returns the value of the kid record component.
      Returns:
      the value of the kid record component
    • use

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