Class StatefulSigner

java.lang.Object
zeroecho.core.storage.StatefulSigner

public final class StatefulSigner extends Object
Durable signing capability for a newly enrolled LMS/XMSS key. Every invocation reloads the key and validates the independent authority. This handle borrows its keyring and authority; both must remain open. It owns no closeable resource. Generic signature contexts continue to reject stateful private keys.
  • Method Details

    • sign

      public byte[] sign(RepeatableContent content, CancellationSignal cancellation, int maximumMessageBytes) throws IOException, GeneralSecurityException
      Signs after durably advancing the stored parent by one leaf. A cancellation, content error or provider failure after reservation burns that leaf. Pending or uncertain persistence fails closed and requires recovery; it is never retried. Content is borrowed, and each opened stream is closed. Calls serialize with store mutation, closure and other signatures. XMSS's provider buffers the message, bounded by the caller's explicit size policy. Persistence rewrites the whole encrypted keyring image per signature. All keys sharing an authority serialize, including content I/O. Callers must supply bounded or interruptible I/O: cancellation is cooperative between reads and does not interrupt lock acquisition or a blocked read.
      Parameters:
      content - repeatable content
      cancellation - cancellation signal
      maximumMessageBytes - nonnegative caller-selected input-size limit; provider memory is O(n), not an exact byte budget
      Returns:
      independently owned signature bytes
      Throws:
      IOException - if content, cancellation or durable state handling fails
      GeneralSecurityException - if the cryptographic operation fails
      NullPointerException - if an argument is null
      IllegalArgumentException - if the input-size limit is negative
    • signatureLength

      public int signatureLength() throws IOException, GeneralSecurityException
      Reads signature-size metadata without reserving a leaf or signing a probe.
      Returns:
      exact signature length in bytes
      Throws:
      IOException - if the enrollment cannot be authenticated
      GeneralSecurityException - if key parameters are unsupported