Record Class CaCreateCommand

java.lang.Object
java.lang.Record
zeroecho.pki.api.ca.CaCreateCommand
Record Components:
formatId - target credential format
subjectRef - normalized CA subject reference
profileId - nonblank strict UTF-8 profile id, at most 256 bytes
keyRef - existing managed key, nonblank strict UTF-8, at most 1,048,576 bytes
altKeyRef - optional alternative key reference for hybrid certificate issuance; when absent the profile's default alternative key reference is used
attributes - universal attributes (may be empty but not null)

public record CaCreateCommand(FormatId formatId, SubjectRef subjectRef, String profileId, KeyRef keyRef, Optional<KeyRef> altKeyRef, AttributeSet attributes) extends Record
Command to create a new root CA entity and issue its initial CA credential.

The managed key is mandatory; construction neither generates keys nor proves possession or authorizes creation. Execution must authorize the operation separately and verify a fresh self-signature against the same frozen canonical SubjectPublicKeyInfo used for the new credential. No retained proof substitutes for this fresh root self-signature.

  • Constructor Details

    • CaCreateCommand

      public CaCreateCommand(FormatId formatId, SubjectRef subjectRef, String profileId, KeyRef keyRef, Optional<KeyRef> altKeyRef, AttributeSet attributes)
      Creates a CA create command.
      Throws:
      IllegalArgumentException - if any required component is null or bounded text is invalid
    • CaCreateCommand

      public CaCreateCommand(FormatId formatId, SubjectRef subjectRef, String profileId, KeyRef keyRef, AttributeSet attributes)
      Creates a CA create command without an explicit alternative key reference. The profile's default alternative key reference will be used for hybrid issuance.
      Parameters:
      formatId - target credential format
      subjectRef - normalized CA subject reference
      profileId - nonblank strict UTF-8 profile id, at most 256 bytes
      keyRef - existing managed key, nonblank strict UTF-8, at most 1,048,576 bytes
      attributes - universal attributes (may be empty but not null)
      Throws:
      IllegalArgumentException - if any component is null or bounded text is invalid
  • Method Details

    • toString

      public String toString()
      Returns a diagnostic representation without command coordinates or attributes.
      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.
    • formatId

      public FormatId formatId()
      Returns the value of the formatId record component.
      Returns:
      the value of the formatId record component
    • subjectRef

      public SubjectRef subjectRef()
      Returns the value of the subjectRef record component.
      Returns:
      the value of the subjectRef record component
    • profileId

      public String profileId()
      Returns the value of the profileId record component.
      Returns:
      the value of the profileId record component
    • keyRef

      public KeyRef keyRef()
      Returns the value of the keyRef record component.
      Returns:
      the value of the keyRef record component
    • altKeyRef

      public Optional<KeyRef> altKeyRef()
      Returns the value of the altKeyRef record component.
      Returns:
      the value of the altKeyRef record component
    • attributes

      public AttributeSet attributes()
      Returns the value of the attributes record component.
      Returns:
      the value of the attributes record component