SEcube open-source SDK
L1_error_manager.h
Go to the documentation of this file.
1 
10 #ifndef _L1_ERROR_MANAGER_H
11 #define _L1_ERROR_MANAGER_H
12 
13 #include <iostream>
14 #include <exception>
15 
16 class L1Exception : public std::exception {
17 public:
18  virtual const char* what() const throw() {
19  return "General exception in the L1 API";
20  }
21 };
22 
23 class L1AlreadyOpenException : public L1Exception {
24 public:
25  virtual const char* what() const throw() {
26  return "SECube already opened";
27  }
28 };
29 
30 class L1OutOfBoundsException : public L1Exception {
31 public:
32  virtual const char* what() const throw() {
33  return "Pointing outside the vector!";
34  }
35 };
36 
37 class L1TXRXException : public L1Exception {
38 public:
39  virtual const char* what() const throw() {
40  return "Error while transmitting data!";
41  }
42 };
43 
44 class L1PayloadDecryptionException : public L1Exception {
45 public:
46  virtual const char* what() const throw() {
47  return "Error In the Payload Decryption!";
48  }
49 };
50 
51 class L1CommunicationError : public L1Exception {
52 public:
53  virtual const char* what() const throw() {
54  return "Error In the communication!";
55  }
56 };
57 
58 class L1LoginException : public L1Exception {
59 public:
60  virtual const char* what() const throw() {
61  return "Error In the Login!";
62  }
63 };
64 
65 class L1CryptoSetTimeException : public L1Exception {
66 public:
67  virtual const char* what() const throw() {
68  return "Error setting the crypto time!";
69  }
70 };
71 
72 class L1CryptoInitException : public L1Exception {
73 public:
74  virtual const char* what() const throw() {
75  return "Error initializing the crypto session!";
76  }
77 };
78 
79 class L1CryptoUpdateException : public L1Exception {
80 public:
81  virtual const char* what() const throw() {
82  return "Error updating the crypto session!";
83  }
84 };
85 
86 class L1LogoutException : public L1Exception {
87 public:
88  virtual const char* what() const throw() {
89  return "Error logging out!";
90  }
91 };
92 
93 class L1EncryptException : public L1Exception {
94 public:
95  virtual const char* what() const throw() {
96  return "Error while encrypting!";
97  }
98 };
99 
100 class L1DecryptException : public L1Exception {
101 public:
102  virtual const char* what() const throw() {
103  return "Error while decrypting!";
104  }
105 };
106 
107 class L1DigestException : public L1Exception {
108 public:
109  virtual const char* what() const throw() {
110  return "Error while digesting!";
111  }
112 };
113 
114 class L1GetAlgorithmsException : public L1Exception {
115 public:
116  virtual const char* what() const throw() {
117  return "Error while getting algorithms!";
118  }
119 };
120 
121 class L1ConfigException : public L1Exception {
122 public:
123  virtual const char* what() const throw() {
124  return "Error while configuring L1!";
125  }
126 };
127 
128 class L1KeyEditException : public L1Exception {
129 public:
130  virtual const char* what() const throw() {
131  return "Error while editing the key!";
132  }
133 };
134 
135 class L1KeyListException : public L1Exception {
136 public:
137  virtual const char* what() const throw() {
138  return "Error while listing the keys!";
139  }
140 };
141 
142 class L1FindKeyException : public L1Exception {
143 public:
144  virtual const char* what() const throw() {
145  return "Error while finding the key!";
146  }
147 };
148 
149 class L1SelectDeviceException : public L1Exception {
150 public:
151  virtual const char* what() const throw() {
152  return "Error while changing the device!";
153  }
154 };
155 
156 class L1GroupEditException : public L1Exception {
157 public:
158  virtual const char* what() const throw() {
159  return "Error while editing the group!";
160  }
161 };
162 
163 #endif