1 package org.bouncycastle.x509; 2 3 import java.security.cert.CertPath; 4 5 import org.bouncycastle.i18n.ErrorBundle; 6 import org.bouncycastle.i18n.LocalizedException; 7 8 public class CertPathReviewerException extends LocalizedException 9 { 10 11 private int index = -1; 12 13 private CertPath certPath = null; 14 CertPathReviewerException(ErrorBundle errorMessage, Throwable throwable)15 public CertPathReviewerException(ErrorBundle errorMessage, Throwable throwable) 16 { 17 super(errorMessage, throwable); 18 } 19 CertPathReviewerException(ErrorBundle errorMessage)20 public CertPathReviewerException(ErrorBundle errorMessage) 21 { 22 super(errorMessage); 23 } 24 CertPathReviewerException( ErrorBundle errorMessage, Throwable throwable, CertPath certPath, int index)25 public CertPathReviewerException( 26 ErrorBundle errorMessage, 27 Throwable throwable, 28 CertPath certPath, 29 int index) 30 { 31 super(errorMessage, throwable); 32 if (certPath == null || index == -1) 33 { 34 throw new IllegalArgumentException(); 35 } 36 if (index < -1 || index >= certPath.getCertificates().size()) 37 { 38 throw new IndexOutOfBoundsException(); 39 } 40 this.certPath = certPath; 41 this.index = index; 42 } 43 CertPathReviewerException( ErrorBundle errorMessage, CertPath certPath, int index)44 public CertPathReviewerException( 45 ErrorBundle errorMessage, 46 CertPath certPath, 47 int index) 48 { 49 super(errorMessage); 50 if (certPath == null || index == -1) 51 { 52 throw new IllegalArgumentException(); 53 } 54 if (index < -1 || index >= certPath.getCertificates().size()) 55 { 56 throw new IndexOutOfBoundsException(); 57 } 58 this.certPath = certPath; 59 this.index = index; 60 } 61 getCertPath()62 public CertPath getCertPath() 63 { 64 return certPath; 65 } 66 getIndex()67 public int getIndex() 68 { 69 return index; 70 } 71 72 } 73