1 package org.enhydra.oyster.exception; 2 3 10 11 15 public class ErrorStorage 16 { 17 22 public static String getErrorMesage(int errNumber0) { 23 String errMsg = ""; 24 switch (errNumber0) { 25 case 1000: 27 errMsg = "SMIME Error 1000: Identifier octet in DER encoding value " + 28 "can't be negative!"; 29 break; 30 case 1001: 31 errMsg = "SMIME Error 1001: Identifier octet in DER encoding value " + 32 "must be less than 255!"; 33 break; 34 case 1002: 35 errMsg = "SMIME Error 1002: Complex Identifier octets in DER encoding" + 36 " value are not suported in this version of DERObject!"; 37 break; 38 case 1003: 39 errMsg = "SMIME Error 1003: Can't use addContent method with Null DER" + 40 " object!"; 41 break; 42 case 1004: 43 errMsg = "SMIME Error 1004: Content of DER object must be present. Use"+ 44 " addContent method or other constructor!"; 45 break; 46 case 1005: 48 errMsg = "SMIME Error 1005: Content could be added only once in "+ 49 "primitive DERClassContextSpecific object!"; 50 break; 51 case 1006: 53 errMsg = "SMIME Error 1006: Number of unused bits must be in range " + 54 "0-7!"; 55 break; 56 case 1007: 57 errMsg = "SMIME Error 1007: BitString can contain only characters 0 " + 58 "or 1!"; 59 break; 60 case 1008: 62 errMsg = "SMIME Error 1008: No dots in \"DOT_SEPARATED_ARRAY\" " + 63 "construction!"; 64 break; 65 case 1009: 66 errMsg = "SMIME Error 1009: Allowable types of construction are: " + 67 "\"DOT_SEPARATED_ARRAY\" and \"NAME_STRING\"!"; 68 break; 69 case 1010: 70 errMsg = "Unknown type of Object identifier!"; 71 break; 72 case 1011: 74 errMsg = "SMIME Error 1011: Number of bytes in imported symmetric Key" + 75 " is incorect!"; 76 break; 77 case 1012: 81 errMsg = "SMIME Error 1012: Number of bytes in imported IV must be 8!"; 82 break; 83 case 1013: 86 errMsg = "SMIME Error 1013: Allowed algorithm names are: DES_EDE3_CBC,"+ 87 " RC2_CBC or DES!"; 88 break; 89 case 1014: 92 errMsg = "SMIME Error 1014: Key size in bits for RC2 algorithm must " + 93 "be 40, 64 or 128!"; 94 break; 95 case 1015: 97 errMsg = "SMIME Error 1015: Key size in bits for DESede3 algorithm " + 98 "must be 128 or 192!"; 99 break; 100 case 1016: 101 errMsg = "SMIME Error 1016: Key size in bits for DES algorithm must " + 102 "be 56!"; 103 break; 104 case 1017: 106 errMsg = "SMIME Error 1017: No value for specified attribute!"; 107 break; 108 case 1018: 114 errMsg = "SMIME Error 1018: Order of adding components is unproper!"; 115 break; 116 case 1019: 118 errMsg = "SMIME Error 1019: CMS Version must be 0,1,2,3 or 4!"; 119 break; 120 case 1020: 122 errMsg = "SMIME Error 1020: Unknown type of Capabilities Attributes!"; 123 break; 124 case 1021: 126 errMsg = "SMIME Error 1021: Function addAllRelativeDN was already " + 127 "performed!"; 128 break; 129 case 1022: 131 errMsg = "SMIME Error 1022: Recipient is alredy added!"; 132 break; 133 case 1023: 135 errMsg = "SMIME Error 1023: This function can not be performed twice " + 136 "for one object!"; 137 break; 138 case 1024: 139 errMsg = "SMIME Error 1024: This function can be performed only with" + 140 " the simplest constructor!"; 141 break; 142 case 1025: 144 errMsg = "SMIME Error 1025: No attribute was added!"; 145 break; 146 case 1026: 148 errMsg = "SMIME Error 1026: Missing owner's certificate!"; 149 break; 150 case 1027: 151 errMsg = "SMIME Error 1027: Missing owner's private key!"; 152 break; 153 case 1028: 155 errMsg = "SMIME Error 1028: Serial numbers of capabilities parameter " + 156 "must be between 0 and 5!"; 157 break; 158 case 1029: 159 errMsg = "SMIME Error 1029: Neither the same group of capabilities can " + 160 "be add twice, nor any group can be added after DEFAULT type!"; 161 break; 162 case 1030: 163 errMsg = "SMIME Error 1030: Type of set capabilities attributes must " + 164 "be: SIGNATURE, SYMMETRIC or ENCIPHER!"; 165 break; 166 case 1031: 167 errMsg = "SMIME Error 1031: Allowed signing algorithms are: " + 168 "SHA1_WITH_RSA, MD2_WITH_RSA, MD5_WITH_RSA or SHA1_WITH_DSA!"; 169 break; 170 case 1032: 172 errMsg = "SMIME Error 1032: Line breaks must be grather than 0 and " + 173 "less than or equal to 76!"; 174 break; 175 case 1033: 177 errMsg = "SMIME Error 1033: Searching array is bigger than / or equal to" + 178 " lookup array!"; 179 case 1034: 182 errMsg = "SMIME Error 1034: File does not exist!"; 183 break; 184 case 1035: 186 errMsg = "SMIME Error 1035: Parameter content shouldn't be null in " + 187 "setContent method!"; 188 break; 189 case 1036: 191 errMsg = "SMIME Error 1036: Unknown type Content-Transfer-Encoding!"+ 192 " Allowable types are: 7bit, quoted-printable and base64!"; 193 break; 194 case 1037: 196 errMsg = "SMIME Error 1037: Problem with aliases in pfx or p12 file!"; 197 break; 198 case 1038: 199 errMsg = "SMIME Error 1038: Problem with extracting certificate chain" + 200 " from .pfx or .p12 file!"; 201 break; 202 case 1039: 204 errMsg = "SMIME Error 1039: At least one recipient must be added " + 205 "before performing signing() method!"; 206 break; 207 case 1040: 209 errMsg = "SMIME Error 1040: At least one signer must be added before " + 210 "performing enveloping() method!"; 211 break; 212 case 1041: 214 errMsg = "SMIME Error 1041: FROM address or name of SMTP host is null!"; 215 break; 216 case 1042: 217 errMsg = "SMIME Error 1042: Type must be TO, CC, or BCC!"; 218 break; 219 case 1043: 220 errMsg = "SMIME Error 1043: One of recipients must be declared as TO " + 221 "recipient!"; 222 break; 223 case 1044: 224 errMsg = "SMIME Error 1044: There is no message for enveloping/signing!"; 225 break; 226 case 1045: 228 errMsg = "SMIME Error 1045: Method setCapabilities can be performed " + 229 "only three times for one signer!"; 230 break; 231 case 1046: 233 errMsg = "SMIME Error 1046: Parameters for message protection order" + 234 " must be SIGN_FIRST or ENCRYPT_FIRST"; 235 break; 236 case 1048: 243 errMsg = "SMIME Error 1048: Content type must be \"text/plain\" or " + 244 "\"text/html\"!"; 245 break; 246 case 1049: 247 errMsg = "SMIME Error 1049: Content of message couldn't be added twice!"; 248 break; 249 250 case 1999: 251 errMsg = "SMIME Error 1999: Caused by non SMIMEException!"; 252 break; 253 default: 254 errMsg = "SMIME Error 9999: Unknown Error type: " + errNumber0 + "!"; 255 } 256 return errMsg; 257 } 258 } | Popular Tags |