libcryptosec
SymmetricCipherException.h
Go to the documentation of this file.
1 #ifndef SYMMETRICCIPHEREXCEPTION_H_
2 #define SYMMETRICCIPHEREXCEPTION_H_
3 
5 
7 {
8 public:
9  enum ErrorCode
10  {
17  };
19  {
20  this->where = where;
22  }
24  {
25  this->where = where;
26  this->errorCode = errorCode;
27  }
28  virtual ~SymmetricCipherException() throw () {}
29  virtual std::string getMessage() const
30  {
32  }
33  virtual std::string toString() const
34  {
35  std::string ret;
37  {
38  ret = "SymmetricCipherException. Called by: " + this->where + ".";
39  }
40  else
41  {
42  ret = "SymmetricCipherException: " + SymmetricCipherException::errorCode2Message(this->errorCode) + ". Called by: " + this->where + ".";
43  }
44  return ret;
45  }
47  {
48  return this->errorCode;
49  }
51  {
52  std::string ret;
53  switch (errorCode)
54  {
56  ret = "Unknown error";
57  break;
59  ret = "Invalid symmetric cipher";
60  break;
62  ret = "Creating symmetric cipher context";
63  break;
65  ret = "Updating symmetric cipher context";
66  break;
68  ret = "Finishing symmetric cipher context";
69  break;
71  ret = "No input data";
72  break;
73 // case SymmetricCipherException::NO_INPUT_DATA:
74 // ret = "";
75 // break;
76 // case SymmetricCipherException::NO_INPUT_DATA:
77 // ret = "";
78 // break;
79 // case SymmetricCipherException::NO_INPUT_DATA:
80 // ret = "";
81 // break;
82  }
83  return ret;
84  }
85 protected:
87 };
88 
89 #endif /*SYMMETRICCIPHEREXCEPTION_H_*/
Definition: SymmetricCipherException.h:15
SymmetricCipherException::ErrorCode errorCode
Definition: SymmetricCipherException.h:86
static std::string errorCode2Message(SymmetricCipherException::ErrorCode errorCode)
Definition: SymmetricCipherException.h:50
SymmetricCipherException(std::string where)
Definition: SymmetricCipherException.h:18
Definition: SymmetricCipherException.h:6
Definition: SymmetricCipherException.h:16
Definition: SymmetricCipherException.h:11
Definition: SymmetricCipherException.h:14
Definition: LibCryptoSecException.h:8
std::string where
Definition: LibCryptoSecException.h:23
Definition: SymmetricCipherException.h:13
virtual ~SymmetricCipherException()
Definition: SymmetricCipherException.h:28
SymmetricCipherException(SymmetricCipherException::ErrorCode errorCode, std::string where)
Definition: SymmetricCipherException.h:23
virtual std::string toString() const
Definition: SymmetricCipherException.h:33
ErrorCode
Definition: SymmetricCipherException.h:9
Definition: SymmetricCipherException.h:12
virtual std::string getMessage() const
Definition: SymmetricCipherException.h:29
virtual SymmetricCipherException::ErrorCode getErrorCode()
Definition: SymmetricCipherException.h:46