Class KeyringSignatureExecutor
Instances retain only the owning KeyringStore and
ZeroEchoSession; they never retain, expose, encode, or log private key
material. Each invocation resolves its key entries independently and creates
operation-local signature contexts. Instances are safe for concurrent use when
callers provide independent content and cancellation objects.
Signing runs in O(n) time for an n-byte payload and uses
O(1) transfer memory plus storage bounded by the selected algorithm's
signature length. The executor closes streams opened for the invocation but
does not close the caller-owned RepeatableContent.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classCause-free marker indicating cancellation observed at a documented signing checkpoint.static final classChecked, redacted failure raised by key resolution or provider execution.static enumStable, non-sensitive failure categories. -
Constructor Summary
ConstructorsConstructorDescriptionKeyringSignatureExecutor(KeyringStore keyring, ZeroEchoSession session) Creates an executor bound to an open keyring and a session. -
Method Summary
Modifier and TypeMethodDescriptionbyte[]sign(String privateAlias, AlgorithmIdentity algorithmIdentity, RepeatableContent content, CancellationSignal cancellation) Signs repeatable content using a private key resolved within this executor.
-
Constructor Details
-
KeyringSignatureExecutor
Creates an executor bound to an open keyring and a session.- Parameters:
keyring- owning keyring used to resolve provider-local aliasessession- session whose policy and provider configuration govern signing- Throws:
NullPointerException- if either argument isnull
-
-
Method Details
-
sign
public byte[] sign(String privateAlias, AlgorithmIdentity algorithmIdentity, RepeatableContent content, CancellationSignal cancellation) throws IOException, KeyringSignatureExecutor.Failure Signs repeatable content using a private key resolved within this executor.The algorithm identity must resolve to a registered interop profile through its canonical form. The stored private-key entry must carry that profile's exact key algorithm identifier. Cancellation is checked before key resolution, before opening the content, and between bounded reads.
- Parameters:
privateAlias- provider-local private-key alias; must not be blankalgorithmIdentity- exact canonical signature identitycontent- caller-owned repeatable content; never closed herecancellation- cancellation signal consulted during the operation- Returns:
- independently owned external signature bytes
- Throws:
IllegalArgumentException- if an alias is blank or the identity is not a signature identityNullPointerException- if any non-alias argument isnullIOException- if keyring resolution, authentication, or filesystem I/O fails; if content opening or streaming fails; or if a stream makes zero progressKeyringSignatureExecutor.Failure- if a key is unavailable, the algorithm does not match, or provider execution fails; LMS/XMSS keys yieldALGORITHM_MISMATCH
-