Record Class RootKey

java.lang.Object
java.lang.Record
com.iizix.license.v2.RootKey
Record Components:
kid - The key ID, of the form KeyCertificate.KEY_ID_PATTERN.
key - The Ed25519 public key.

public record RootKey(String kid, PublicKey key) extends Record
A pinned root key (LICENSE-V2-DESIGN.md section 2.4, ruling LV-3): the key ID a key certificate's kid line names, and the public half of the offline root that signs certificates. Not secret.
Author:
Christopher Mindus
  • Constructor Details

  • Method Details

    • of

      public static RootKey of(String kid, String text)
      Creates a root from its key ID and key text, the form a pinned constant is written in.
      Parameters:
      kid - The key ID.
      text - The public key as Ed25519.publicKeyToBase64Url(PublicKey) writes it.
      Returns:
      The root.
      Throws:
      IllegalArgumentException - If the key ID is malformed or the text is not an Ed25519 public key.
    • keyText

      public String keyText()
      Gets the key as text.
      Returns:
      The public key, base64url.
    • toString

      public String toString()
      The key ID and the key text.
      Specified by:
      toString in class Record
    • 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.
    • kid

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

      public PublicKey key()
      Returns the value of the key record component.
      Returns:
      the value of the key record component