Class InvalidInputException
java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
co.ankatech.ankasecure.sdk.exception.InvalidInputException
- All Implemented Interfaces:
Serializable
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 Summary
ConstructorsConstructorDescriptionInvalidInputException(String message) Constructs a new invalid input exception with the specified message.InvalidInputException(String message, Throwable cause) Constructs a new invalid input 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
-
InvalidInputException
Constructs a new invalid input exception with the specified message and cause.- Parameters:
message- the detail message explaining why the input is invalidcause- the underlying cause of the validation failure
-
InvalidInputException
Constructs a new invalid input exception with the specified message.- Parameters:
message- the detail message explaining why the input is invalid
-