Class CryptoOperationException

java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
co.ankatech.ankasecure.sdk.exception.CryptoOperationException
All Implemented Interfaces:
Serializable

public class CryptoOperationException extends RuntimeException
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 Details

    • CryptoOperationException

      public CryptoOperationException(String message, Throwable cause)
      Constructs a new crypto operation exception with the specified message and cause.
      Parameters:
      message - the detail message explaining the cryptographic failure
      cause - the underlying cause of the operation failure
    • CryptoOperationException

      public CryptoOperationException(String message)
      Constructs a new crypto operation exception with the specified message.
      Parameters:
      message - the detail message explaining the cryptographic failure