01: package org.bouncycastle.asn1.cmp;
02:
03: import org.bouncycastle.asn1.DERBitString;
04:
05: /**
06: * <pre>
07: * PKIFailureInfo ::= BIT STRING {
08: * badAlg (0),
09: * -- unrecognized or unsupported Algorithm Identifier
10: * badMessageCheck (1), -- integrity check failed (e.g., signature did not verify)
11: * badRequest (2),
12: * -- transaction not permitted or supported
13: * badTime (3), -- messageTime was not sufficiently close to the system time, as defined by local policy
14: * badCertId (4), -- no certificate could be found matching the provided criteria
15: * badDataFormat (5),
16: * -- the data submitted has the wrong format
17: * wrongAuthority (6), -- the authority indicated in the request is different from the one creating the response token
18: * incorrectData (7), -- the requester's data is incorrect (for notary services)
19: * missingTimeStamp (8), -- when the timestamp is missing but should be there (by policy)
20: * badPOP (9) -- the proof-of-possession failed
21: * timeNotAvailable (14),
22: * -- the TSA's time source is not available
23: * unacceptedPolicy (15),
24: * -- the requested TSA policy is not supported by the TSA
25: * unacceptedExtension (16),
26: * -- the requested extension is not supported by the TSA
27: * addInfoNotAvailable (17)
28: * -- the additional information requested could not be understood
29: * -- or is not available
30: * systemFailure (25)
31: * -- the request cannot be handled due to system failure
32: * </pre>
33: */
34: public class PKIFailureInfo extends DERBitString {
35:
36: public static final int badAlg = (1 << 7); // unrecognized or unsupported Algorithm Identifier
37: public static final int badMessageCheck = (1 << 6); // integrity check failed (e.g., signature did not verify)
38: public static final int badRequest = (1 << 5);
39: public static final int badTime = (1 << 4); // -- messageTime was not sufficiently close to the system time, as defined by local policy
40: public static final int badCertId = (1 << 3); // no certificate could be found matching the provided criteria
41: public static final int badDataFormat = (1 << 2);
42: public static final int wrongAuthority = (1 << 1); // the authority indicated in the request is different from the one creating the response token
43: public static final int incorrectData = 1; // the requester's data is incorrect (for notary services)
44: public static final int missingTimeStamp = (1 << 15); // when the timestamp is missing but should be there (by policy)
45: public static final int badPOP = (1 << 14); // the proof-of-possession failed
46: public static final int timeNotAvailable = (1 << 9); // the TSA's time source is not available
47: public static final int unacceptedPolicy = (1 << 8); // the requested TSA policy is not supported by the TSA
48: public static final int unacceptedExtension = (1 << 23); //the requested extension is not supported by the TSA
49: public static final int addInfoNotAvailable = (1 << 22); //the additional information requested could not be understood or is not available
50: public static final int systemFailure = (1 << 30); //the request cannot be handled due to system failure
51:
52: /** @deprecated use lower case version */
53: public static final int BAD_ALG = badAlg; // unrecognized or unsupported Algorithm Identifier
54: /** @deprecated use lower case version */
55: public static final int BAD_MESSAGE_CHECK = badMessageCheck;
56: /** @deprecated use lower case version */
57: public static final int BAD_REQUEST = badRequest; // transaction not permitted or supported
58: /** @deprecated use lower case version */
59: public static final int BAD_TIME = badTime;
60: /** @deprecated use lower case version */
61: public static final int BAD_CERT_ID = badCertId;
62: /** @deprecated use lower case version */
63: public static final int BAD_DATA_FORMAT = badDataFormat; // the data submitted has the wrong format
64: /** @deprecated use lower case version */
65: public static final int WRONG_AUTHORITY = wrongAuthority;
66: /** @deprecated use lower case version */
67: public static final int INCORRECT_DATA = incorrectData;
68: /** @deprecated use lower case version */
69: public static final int MISSING_TIME_STAMP = missingTimeStamp;
70: /** @deprecated use lower case version */
71: public static final int BAD_POP = badPOP;
72: /** @deprecated use lower case version */
73: public static final int TIME_NOT_AVAILABLE = timeNotAvailable;
74: /** @deprecated use lower case version */
75: public static final int UNACCEPTED_POLICY = unacceptedPolicy;
76: /** @deprecated use lower case version */
77: public static final int UNACCEPTED_EXTENSION = unacceptedExtension;
78: /** @deprecated use lower case version */
79: public static final int ADD_INFO_NOT_AVAILABLE = addInfoNotAvailable;
80: /** @deprecated use lower case version */
81: public static final int SYSTEM_FAILURE = systemFailure;
82:
83: /**
84: * Basic constructor.
85: */
86: public PKIFailureInfo(int info) {
87: super (getBytes(info), getPadBits(info));
88: }
89:
90: public PKIFailureInfo(DERBitString info) {
91: super (info.getBytes(), info.getPadBits());
92: }
93:
94: public String toString() {
95: return "PKIFailureInfo: 0x"
96: + Integer.toHexString(this.intValue());
97: }
98: }
|