libcryptosec
SignerException.h
Go to the documentation of this file.
1 #ifndef SIGNEREXCEPTION_H_
2 #define SIGNEREXCEPTION_H_
3 
5 
7 {
8 public:
9  enum ErrorCode
10  {
15  };
16  SignerException(std::string where)
17  {
18  this->where = where;
20  }
22  {
23  this->where = where;
24  this->errorCode = errorCode;
25  }
26  virtual ~SignerException() throw () {}
27  virtual std::string getMessage() const
28  {
30  }
31  virtual std::string toString() const
32  {
33  std::string ret;
35  {
36  ret = "SymmetricCipherException. Called by: " + this->where + ".";
37  }
38  else
39  {
40  ret = "SymmetricCipherException: " + SignerException::errorCode2Message(this->errorCode) + ". Called by: " + this->where + ".";
41  }
42  return ret;
43  }
45  {
46  return this->errorCode;
47  }
49  {
50  std::string ret;
51  switch (errorCode)
52  {
54  ret = "Unknown error";
55  break;
57  ret = "Signing data";
58  break;
60  ret = "Verifying data";
61  break;
63  ret = "Unsupported asymmetric key type";
64  break;
65 // case ErrorCode:::
66 // ret = "";
67 // break;
68  }
69  return ret;
70  }
71 protected:
73 
74 
75 };
76 
77 #endif /*SIGNEREXCEPTION_H_*/
SignerException(std::string where)
Definition: SignerException.h:16
Definition: SignerException.h:6
Definition: SignerException.h:13
SignerException::ErrorCode errorCode
Definition: SignerException.h:72
SignerException(SignerException::ErrorCode errorCode, std::string where)
Definition: SignerException.h:21
static std::string errorCode2Message(SignerException::ErrorCode errorCode)
Definition: SignerException.h:48
Definition: LibCryptoSecException.h:8
std::string where
Definition: LibCryptoSecException.h:23
Definition: SignerException.h:11
ErrorCode
Definition: SignerException.h:9
virtual ~SignerException()
Definition: SignerException.h:26
virtual std::string getMessage() const
Definition: SignerException.h:27
virtual SignerException::ErrorCode getErrorCode()
Definition: SignerException.h:44
virtual std::string toString() const
Definition: SignerException.h:31
Definition: SignerException.h:12
Definition: SignerException.h:14