Package zeroecho.core.err
package zeroecho.core.err
Exception types used by the core to signal configuration errors and
unexpected provider failures.
This package defines a small, clear taxonomy of exceptions thrown when constructing or running cryptographic contexts. Use these types to distinguish programming/configuration mistakes from lower-level provider failures.
Exception categories
UnsupportedRoleException- the requestedKeyUsageis not supported by the selected algorithm, or the role is incompatible with the supplied key/spec.UnsupportedSpecException- the providedContextSpecis invalid or incompatible with the requested role or key.ProviderFailureException- an unexpected failure surfaced by an underlying JCA/JCE/PQC provider; the operation cannot proceed safely.
Usage notes
- Treat
UnsupportedRoleExceptionandUnsupportedSpecExceptionas programming or configuration errors that should be fixed by adjusting inputs. - Treat
ProviderFailureExceptionas an operational fault (provider bug, environment issue); log with context and surface a safe error to callers.
Typical usage
try {
zeroecho.core.context.EncryptionContext ctx =
algo.createContext(zeroecho.core.KeyUsage.ENCRYPT, key, spec);
// use ctx...
} catch (zeroecho.core.err.UnsupportedRoleException
| zeroecho.core.err.UnsupportedSpecException e) {
// programming error: wrong role or incompatible key/spec
throw new IllegalArgumentException("Bad configuration", e);
} catch (java.io.IOException e) {
// I/O failure when initializing context
...
} catch (zeroecho.core.err.ProviderFailureException e) {
// unexpected provider failure: wrap, log, or abort
...
}
- Since:
- 1.0
-
Exception ClassesClassDescriptionException signaling a failure in the underlying cryptographic provider during algorithm initialization or operation.Exception indicating that an algorithm does not support the requested role.Exception indicating that a provided key/spec combination is not supported by the algorithm for the requested role.Exception thrown when a cryptographic signature or digest verification fails.