Class StreamIntegrityException
- All Implemented Interfaces:
Serializable
The end-of-stream-integrity streaming operations (stream/decrypt,
stream/reencrypt, stream/resign) frame their response as
multipart/mixed: the streamed payload is PART 1 and a trailing
application/json verdict is PART 2, emitted only AFTER the server has run
its end-of-stream integrity check. The SDK quarantines the payload to a sidecar
(<destination>.part) and promotes it to the final destination via an atomic
rename ONLY when the trailing verdict is VALID.
This exception is raised when the verdict is INVALID (tampered ciphertext,
failed GCM tag, unverifiable old signature) or ABSENT (a truncated stream or a body
carrying no trailing verdict part). In every case the sidecar has already been deleted
and NO file exists at the destination — success is never inferred from a closed socket.
The failure surfaces as this TYPED exception rather than an opaque socket / I/O error.
The carried reason is the server's oracle-safe explanation and
never leaks plaintext, key material, tenant identity, or BouncyCastle / JCE internals.
Extends AnkaSecureSdkException (the SDK's documented exception base) so consumers such
as cli-crypto catch it with a uniform catch (AnkaSecureSdkException e); being a
client-side fail-closed outcome it carries no HTTP status/body (AnkaSecureSdkException.getHttpStatus() is
0) — the integrity dimensions are exposed via getVerdict()/getReason().
- Since:
- 3.0.0
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns the request correlation id, for cross-service tracing.Returns the operation whose end-of-stream verdict failed.Returns the server's oracle-safe reason for the failing verdict.Returns the verdict outcome.Methods inherited from class co.ankatech.ankasecure.sdk.exception.AnkaSecureSdkException
getContext, getErrorCode, getHttpStatus, getResponseBody, getRetryAfterSecondsMethods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
Constructor Details
-
StreamIntegrityException
public StreamIntegrityException(String message, String operation, String verdict, String reason, String correlationId, Throwable cause) Constructs a new streaming-integrity exception.- Parameters:
message- the detail message (oracle-safe; must not embed plaintext / key material)operation- the operation whose verdict failed (may benull)verdict- the verdict outcome —INVALIDorABSENT(may benull)reason- the server's oracle-safe reason (may benull)correlationId- the request correlation id (may benull)cause- the underlying cause (may benull)
-
-
Method Details
-
getOperation
Returns the operation whose end-of-stream verdict failed.- Returns:
decrypt/reencrypt/resign, ornullwhen unknown
-
getVerdict
Returns the verdict outcome.- Returns:
INVALIDorABSENT, ornullwhen unknown
-
getReason
Returns the server's oracle-safe reason for the failing verdict.- Returns:
- the reason, or
nullwhen the server supplied none
-
getCorrelationId
Returns the request correlation id, for cross-service tracing.- Returns:
- the correlation id, or
nullwhen absent
-