Class VerificationException

java.lang.Object
java.lang.Throwable
java.lang.Exception
zeroecho.core.err.VerificationException
All Implemented Interfaces:
Serializable

public class VerificationException extends Exception
Exception thrown when a cryptographic signature or digest verification fails.

This exception may carry the calculated value, and optionally the expected value, to aid in debugging and error reporting. In case of failures originating from lower-level signature APIs, the original SignatureException may be wrapped as the cause.

See Also:
  • Constructor Details

    • VerificationException

      public VerificationException(byte[] a)
      Creates a new exception with only the calculated value.

      This form is typically used when there is no known expected value, but the calculated value is still useful for diagnostics.

      Parameters:
      a - the calculated value, may be null. A defensive copy is made.
    • VerificationException

      public VerificationException(byte[] expected, byte[] a)
      Creates a new exception with both expected and calculated values.

      This form is useful when the verification mismatch can be expressed in terms of what was expected versus what was actually obtained.

      Parameters:
      expected - the expected value, may be null. A defensive copy is made.
      a - the calculated value, may be null. A defensive copy is made.
    • VerificationException

      public VerificationException(SignatureException e, byte[] a)
      Creates a new exception that wraps a lower-level SignatureException.

      This form allows the original exception to be preserved while attaching the calculated value that caused the failure.

      Parameters:
      e - the original signature exception to wrap, must not be null
      a - the calculated value, may be null. A defensive copy is made.
  • Method Details

    • toString

      public String toString()
      Returns a string representation of this exception.

      The returned string includes both expected and calculated values if available, or the message of the wrapped cause if present.

      Overrides:
      toString in class Throwable
      Returns:
      a descriptive string representation of the exception