Package eu.emi.security.authn.x509
Class ValidationError
- java.lang.Object
-
- eu.emi.security.authn.x509.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
-
-
Constructor Summary
Constructors Constructor Description ValidationError(X509Certificate[] chain, int position, ValidationErrorCode errorCode, Object... params)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description X509Certificate[]
getChain()
ValidationErrorCategory
getErrorCategory()
Returns a coarse grained error category.ValidationErrorCode
getErrorCode()
Gets the unique error code.String
getMessage()
Returns human readable message describing this error.Object[]
getParameters()
Gets the error parameters.int
getPosition()
Returns position in chain of the certificate causing the error.static String
makeReason(Throwable t)
static String
makeReasonFromStack(Throwable t)
String
toString()
-
-
-
Constructor Detail
-
ValidationError
public ValidationError(X509Certificate[] chain, int position, ValidationErrorCode errorCode, Object... params)
-
-
Method Detail
-
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
-
-