Class CryptoOperationException
java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
co.ankatech.ankasecure.sdk.exception.CryptoOperationException
- All Implemented Interfaces:
Serializable
Thrown when a cryptographic operation fails due to local processing errors.
This exception indicates that a cryptographic operation failed during local
(client-side) processing, such as JWE parsing, multipart splitting, or utility
operations. Unlike AnkaSecureSdkException which represents server-side
errors, this exception is thrown by local cryptographic utilities.
Common Causes
- Malformed JWE or JWS token (invalid Base64URL encoding)
- Corrupted multipart data during local processing
- File I/O errors during local crypto operations
- Invalid cryptographic parameters in utility operations
- Local encryption/decryption failures in utility methods
Example
try {
// Utility operation that fails locally
JwetMultipartSplitter.parseJweHeader(malformedJwe);
} catch (CryptoOperationException e) {
System.err.println("Local crypto operation failed: " + e.getMessage());
// Output: "Invalid JWE format: expected 5 segments, found 3"
}
- Since:
- 3.0.0
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionCryptoOperationException(String message) Constructs a new crypto operation exception with the specified message.CryptoOperationException(String message, Throwable cause) Constructs a new crypto operation exception with the specified message and cause. -
Method Summary
Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
Constructor Details
-
CryptoOperationException
Constructs a new crypto operation exception with the specified message and cause.- Parameters:
message- the detail message explaining the cryptographic failurecause- the underlying cause of the operation failure
-
CryptoOperationException
Constructs a new crypto operation exception with the specified message.- Parameters:
message- the detail message explaining the cryptographic failure
-