Class InvalidInputException

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

public class InvalidInputException extends RuntimeException
Thrown when input validation fails for SDK operations.

This exception indicates that the input provided to an SDK method does not meet the required format, constraints, or validation rules. Unlike AnkaSecureSdkException which represents server-side errors, this exception is thrown by client-side validation before any API call is made.

Common Causes

  • Invalid algorithm identifier (unsupported by the server)
  • Missing required fields in request objects (e.g., null kid or kty)
  • Incompatible algorithm combinations for composite keys
  • Invalid key operation specifications
  • Malformed cryptographic parameters

Example


 try {
     // Invalid: blank key identifier
     sdk.getKeyMetadata("");
 } catch (InvalidInputException e) {
     System.err.println("Validation error: " + e.getMessage());
     // Output: "Key identifier (kid) is required"
 }
 
Since:
3.0.0
See Also:
  • Constructor Details

    • InvalidInputException

      public InvalidInputException(String message, Throwable cause)
      Constructs a new invalid input exception with the specified message and cause.
      Parameters:
      message - the detail message explaining why the input is invalid
      cause - the underlying cause of the validation failure
    • InvalidInputException

      public InvalidInputException(String message)
      Constructs a new invalid input exception with the specified message.
      Parameters:
      message - the detail message explaining why the input is invalid