Class LocalStatefulSigningAuthority

java.lang.Object
zeroecho.core.storage.LocalStatefulSigningAuthority
All Implemented Interfaces:
AutoCloseable

public final class LocalStatefulSigningAuthority extends Object implements AutoCloseable
Default local monotonic authority for stateful signatures. Its directory must be independently preserved outside keyring/PKI backup and restore domains. Never roll back, clone, replace or reconstruct this authority. Losing it retires its enrolled signing keys. All signing copies must consult the same authority. A lifetime filesystem lock serializes all processes using this root. Closing waits for admitted operations; callers own this resource separately from keyrings. Records contain authenticated public commitments, never private-key material.
  • Method Details

    • create

      public static LocalStatefulSigningAuthority create(Path directory) throws IOException
      Creates an empty authority in a new owner-only directory. Creation never replaces or repairs an existing directory and never enrolls existing keys.
      Parameters:
      directory - new authority directory, outside all backup roots
      Returns:
      exclusively owned authority
      Throws:
      IOException - if secure durable initialization fails
      NullPointerException - if directory is null
    • open

      public static LocalStatefulSigningAuthority open(Path directory) throws IOException
      Opens a previously initialized authority without creating missing state.
      Parameters:
      directory - existing authority directory at its original location
      Returns:
      exclusively owned authority
      Throws:
      IOException - if missing, corrupt, moved, insecure or already owned
      NullPointerException - if directory is null
    • close

      public void close() throws IOException
      Releases exclusive authority ownership after admitted signing completes.
      Specified by:
      close in interface AutoCloseable
      Throws:
      IOException - if releasing the filesystem fence fails