libcryptosec
AsymmetricCipherException.h
Go to the documentation of this file.
1 #ifndef ASYMMETRICCIPHEREXCEPTION_H_
2 #define ASYMMETRICCIPHEREXCEPTION_H_
3 
5 
7 {
8 public:
9  enum ErrorCode
10  {
14  };
16  {
17  this->where = where;
19  }
21  {
22  this->where = where;
23  this->errorCode = errorCode;
24  }
25  virtual ~AsymmetricCipherException() throw () {}
26  virtual std::string getMessage() const
27  {
29  }
30  virtual std::string toString() const
31  {
32  std::string ret;
34  {
35  ret = "AsymmetricCipherException. Called by: " + this->where + ".";
36  }
37  else
38  {
39  ret = "AsymmetricCipherException: " + AsymmetricCipherException::errorCode2Message(this->errorCode) + ". Called by: " + this->where + ".";
40  }
41  return ret;
42  }
44  {
45  return this->errorCode;
46  }
48  {
49  std::string ret;
50  switch (errorCode)
51  {
53  ret = "Unknown error";
54  break;
56  ret = "Encrypting data";
57  break;
59  ret = "Decrypting data";
60  break;
61 // case ErrorCode:::
62 // ret = "";
63 // break;
64  }
65  return ret;
66  }
67 protected:
69 };
70 
71 #endif /*ASYMMETRICCIPHEREXCEPTION_H_*/
Definition: AsymmetricCipherException.h:6
virtual AsymmetricCipherException::ErrorCode getErrorCode()
Definition: AsymmetricCipherException.h:43
ErrorCode
Definition: AsymmetricCipherException.h:9
Definition: AsymmetricCipherException.h:12
Definition: AsymmetricCipherException.h:11
virtual std::string toString() const
Definition: AsymmetricCipherException.h:30
Definition: LibCryptoSecException.h:8
std::string where
Definition: LibCryptoSecException.h:23
static std::string errorCode2Message(AsymmetricCipherException::ErrorCode errorCode)
Definition: AsymmetricCipherException.h:47
AsymmetricCipherException(AsymmetricCipherException::ErrorCode errorCode, std::string where)
Definition: AsymmetricCipherException.h:20
AsymmetricCipherException::ErrorCode errorCode
Definition: AsymmetricCipherException.h:68
Definition: AsymmetricCipherException.h:13
AsymmetricCipherException(std::string where)
Definition: AsymmetricCipherException.h:15
virtual std::string getMessage() const
Definition: AsymmetricCipherException.h:26
virtual ~AsymmetricCipherException()
Definition: AsymmetricCipherException.h:25