Class PqcTransportException
- All Implemented Interfaces:
Serializable
With pqc.transport.enabled=true every response to a wrapped request is one of two things:
a body encrypted under the session key (application/octet-stream, whatever its status), or a
plaintext RFC 9457 problem (application/problem+json) on an error status, written before
the transport layer could encrypt anything. Anything else is refused rather than handed to the caller
as if it had been decrypted: a plaintext body on an encrypted channel is exactly what a tampering or
misrouting intermediary would produce, and accepting it would silently remove the protection the
caller enabled.
The streaming routes are protected by TLS only. Under PQC transport the SDK never chooses one on
its own, whatever a size limit or a refusal suggests: PqcTransportException.Reason.STREAMING_NOT_CHOSEN names the
streaming operation the caller can call explicitly.
Unchecked, like Http2RequiredException: it is raised from an OkHttp interceptor or from an
operation's route selection and must reach the caller through the catch (ApiException |
IOException) arms of the service layer unchanged. A refused response carries
SdkErrorCode.IO, the code that failure carried before it was typed; a route the SDK will not
choose carries SdkErrorCode.UNKNOWN, like the other client-side transport refusals. The
message never carries a response body.
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumWhy the request was refused. -
Field Summary
Fields inherited from class co.ankatech.ankasecure.sdk.exception.AnkaSecureSdkException
MAX_RETRY_AFTER_SECONDS -
Constructor Summary
ConstructorsConstructorDescriptionPqcTransportException(PqcTransportException.Reason reason, int httpStatus, String mediaType, Throwable cause) A refused response. -
Method Summary
Modifier and TypeMethodDescriptionstatic PqcTransportExceptionstreamingNotChosen(String streamingOperation, String why, int httpStatus, Throwable cause) The refusal of a streaming route the caller did not choose.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
-
PqcTransportException
public PqcTransportException(PqcTransportException.Reason reason, int httpStatus, String mediaType, Throwable cause) A refused response.- Parameters:
reason-PqcTransportException.Reason.UNENCRYPTED_RESPONSEorPqcTransportException.Reason.UNDECRYPTABLE_RESPONSEhttpStatus- the HTTP status of the refused responsemediaType- the media type the response declared, ornullwhen it declared nonecause- the underlying failure, ornull- Throws:
IllegalArgumentException- forPqcTransportException.Reason.STREAMING_NOT_CHOSEN, whichstreamingNotChosen(String, String, int, Throwable)builds
-
-
Method Details
-
streamingNotChosen
public static PqcTransportException streamingNotChosen(String streamingOperation, String why, int httpStatus, Throwable cause) The refusal of a streaming route the caller did not choose.- Parameters:
streamingOperation- the SDK operation that sends this payload over the streaming route, e.g.encryptFileStream(String, Path, Path)why- what pointed at the streaming route, one sentencehttpStatus- the status of the refusal that pointed there, or0when no request was sentcause- that refusal, ornull- Returns:
- the refusal
-
getReason
- Returns:
- why the request was refused
-