Class StatefulSigner
java.lang.Object
zeroecho.core.storage.StatefulSigner
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 Summary
Modifier and TypeMethodDescriptionbyte[]sign(RepeatableContent content, CancellationSignal cancellation, int maximumMessageBytes) Signs after durably advancing the stored parent by one leaf.intReads signature-size metadata without reserving a leaf or signing a probe.
-
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 contentcancellation- cancellation signalmaximumMessageBytes- 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 failsGeneralSecurityException- if the cryptographic operation failsNullPointerException- if an argument is nullIllegalArgumentException- if the input-size limit is negative
-
signatureLength
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 authenticatedGeneralSecurityException- if key parameters are unsupported
-