eu.emi.security.authn.x509
Class ValidationError

java.lang.Object
  extended by 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
ValidationError(X509Certificate[] chain, int position, ValidationErrorCode errorCode, Object... params)
           
 
Method Summary
 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()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ValidationError

public ValidationError(X509Certificate[] chain,
                       int position,
                       ValidationErrorCode errorCode,
                       Object... params)
Method Detail

makeReasonFromStack

public static String makeReasonFromStack(Throwable t)

makeReason

public static String makeReason(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

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2012-2013 European Middleware Initiative. All Rights Reserved.