Class ValidationError


  • public class ValidationError
    extends Object
    Holds information about a single validation problem with a reference to the certificate chain. Each error may refer to particular certificate in the chain, contains an unique code and a coarse grained category.
    Author:
    K. Benedyczak
    See Also:
    ValidationResult, ValidationErrorListener, ValidationErrorCategory
    • Method Detail

      • makeReasonFromStack

        public static String makeReasonFromStack​(Throwable t)
      • getPosition

        public int getPosition()
        Returns position in chain of the certificate causing the error. If the error is related to chain inconsistency (so more then one certificate is involved) then the lowest number of the certificate involved must be returned.
        Returns:
        position of the erroneous certificate in chain or -1 if not defied.
      • getMessage

        public String getMessage()
        Returns human readable message describing this error. The message is formatted in accordance to the current locale settings.
        Returns:
        the error message
      • getErrorCode

        public ValidationErrorCode getErrorCode()
        Gets the unique error code. Error codes are defined in bundle with messages (in a properties file).
        Returns:
        the error code
      • getParameters

        public Object[] getParameters()
        Gets the error parameters.
        Returns:
        the error parameters
      • getErrorCategory

        public ValidationErrorCategory getErrorCategory()
        Returns a coarse grained error category.
        Returns:
        error category
      • getChain

        public X509Certificate[] getChain()
        Returns:
        the certificate chain which caused the validation error