FileDocCategorySizeDatePackage
CertPathValidatorException.javaAPI DocAndroid 1.5 API4874Wed May 06 22:41:06 BST 2009java.security.cert

CertPathValidatorException

public class CertPathValidatorException extends GeneralSecurityException
The exception that is thrown when a certification path (or certificate chain) cannot be validated.

A {@code CertPathValidatorException} may optionally include the certification path instance that failed the validation and the index of the failed certificate.

since
Android 1.0

Fields Summary
private static final long
serialVersionUID
private CertPath
certPath
the certification path.
private int
index
the index of the certificate.
Constructors Summary
public CertPathValidatorException(String msg, Throwable cause, CertPath certPath, int index)
Creates a new {@code CertPathValidatorException} with the specified message , cause, certification path and certificate index in the certification path.

param
msg the detail message for this exception.
param
cause the cause.
param
certPath the certification path that failed the validation.
param
index the index of the failed certificate.
throws
IllegalArgumentException if {@code certPath} is {@code null} and index is not {@code -1}.
throws
IndexOutOfBoundsException if {@code certPath} is not {@code null} and index is not referencing an certificate in the certification path.
since
Android 1.0


                                                                                                                                                                                            
        
                
        super(msg, cause);
        // check certPath and index parameters
        if ((certPath == null) && (index != -1)) {
            throw new IllegalArgumentException(
                    Messages.getString("security.53")); //$NON-NLS-1$
        }
        if ((certPath != null)
                && ((index < -1) || (index >= certPath.getCertificates().size()))) {
            throw new IndexOutOfBoundsException(Messages.getString("security.54")); //$NON-NLS-1$
        }
        this.certPath = certPath;
        this.index = index;
    
public CertPathValidatorException(String msg, Throwable cause)
Creates a new {@code CertPathValidatorException} with the specified message and cause.

param
msg the detail message for this exception.
param
cause the cause why the path could not be validated.
since
Android 1.0

        super(msg, cause);
    
public CertPathValidatorException(Throwable cause)
Creates a new {@code CertPathValidatorException} with the specified cause.

param
cause the cause why the path could not be validated.
since
Android 1.0

        super(cause);
    
public CertPathValidatorException(String msg)
Creates a new {@code CertPathValidatorException} with the specified message.

param
msg the detail message for this exception.
since
Android 1.0

        super(msg);
    
public CertPathValidatorException()
Creates a new {@code CertPathValidatorException}.

since
Android 1.0

    
Methods Summary
public java.security.cert.CertPathgetCertPath()
Returns the certification path that failed validation.

return
the certification path that failed validation, or {@code null} if none was specified.
since
Android 1.0

        return certPath;
    
public intgetIndex()
Returns the index of the failed certificate in the certification path.

return
the index of the failed certificate in the certification path, or {@code -1} if none was specified.
since
Android 1.0

        return index;