All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.spongycastle.x509.CertPathReviewerException Maven / Gradle / Ivy

Go to download

Spongy Castle is a package-rename (org.bouncycastle.* to org.spongycastle.*) of Bouncy Castle intended for the Android platform. Android unfortunately ships with a stripped-down version of Bouncy Castle, which prevents easy upgrades - Spongy Castle overcomes this and provides a full, up-to-date version of the Bouncy Castle cryptographic libs.

The newest version!
package org.spongycastle.x509;

import java.security.cert.CertPath;

import org.spongycastle.i18n.ErrorBundle;
import org.spongycastle.i18n.LocalizedException;

public class CertPathReviewerException extends LocalizedException
{

    private int index = -1;
    
    private CertPath certPath = null;
    
    public CertPathReviewerException(ErrorBundle errorMessage, Throwable throwable)
    {
        super(errorMessage, throwable);
    }

    public CertPathReviewerException(ErrorBundle errorMessage)
    {
        super(errorMessage);
    }

    public CertPathReviewerException(
            ErrorBundle errorMessage, 
            Throwable throwable,
            CertPath certPath,
            int index)
    {
        super(errorMessage, throwable);
        if (certPath == null || index == -1)
        {
            throw new IllegalArgumentException();
        }
        if (index < -1 || (certPath != null && index >= certPath.getCertificates().size()))
        {
            throw new IndexOutOfBoundsException();
        }
        this.certPath = certPath;
        this.index = index;
    }
    
    public CertPathReviewerException(
            ErrorBundle errorMessage, 
            CertPath certPath,
            int index)
    {
        super(errorMessage);
        if (certPath == null || index == -1)
        {
            throw new IllegalArgumentException();
        }
        if (index < -1 || (certPath != null && index >= certPath.getCertificates().size()))
        {
            throw new IndexOutOfBoundsException();
        }
        this.certPath = certPath;
        this.index = index;
    }
    
    public CertPath getCertPath()
    {
        return certPath;
    }
    
    public int getIndex()
    {
        return index;
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy