01: package org.bouncycastle.x509;
02:
03: import java.security.cert.CertPath;
04:
05: import org.bouncycastle.i18n.ErrorBundle;
06: import org.bouncycastle.i18n.LocalizedException;
07:
08: public class CertPathReviewerException extends LocalizedException {
09:
10: private int index = -1;
11:
12: private CertPath certPath = null;
13:
14: public CertPathReviewerException(ErrorBundle errorMessage,
15: Throwable throwable) {
16: super (errorMessage, throwable);
17: }
18:
19: public CertPathReviewerException(ErrorBundle errorMessage) {
20: super (errorMessage);
21: }
22:
23: public CertPathReviewerException(ErrorBundle errorMessage,
24: Throwable throwable, CertPath certPath, int index) {
25: super (errorMessage, throwable);
26: if (certPath == null || index == -1) {
27: throw new IllegalArgumentException();
28: }
29: if (index < -1
30: || (certPath != null && index >= certPath
31: .getCertificates().size())) {
32: throw new IndexOutOfBoundsException();
33: }
34: this .certPath = certPath;
35: this .index = index;
36: }
37:
38: public CertPathReviewerException(ErrorBundle errorMessage,
39: CertPath certPath, int index) {
40: super (errorMessage);
41: if (certPath == null || index == -1) {
42: throw new IllegalArgumentException();
43: }
44: if (index < -1
45: || (certPath != null && index >= certPath
46: .getCertificates().size())) {
47: throw new IndexOutOfBoundsException();
48: }
49: this .certPath = certPath;
50: this .index = index;
51: }
52:
53: public CertPath getCertPath() {
54: return certPath;
55: }
56:
57: public int getIndex() {
58: return index;
59: }
60:
61: }
|