libcryptosec
CertificationException.h
Go to the documentation of this file.
1 #ifndef CERTIFICATIONEXCEPTION_H_
2 #define CERTIFICATIONEXCEPTION_H_
3 
5 
7 {
8 public:
9  enum ErrorCode
10  {
22  };
24  {
25  this->where = where;
27  }
29  {
30  this->where = where;
31  this->errorCode = errorCode;
32  }
33  virtual ~CertificationException() throw () {}
34  virtual std::string getMessage() const
35  {
37  }
38  virtual std::string toString() const
39  {
40  std::string ret;
42  {
43  ret = "CertificationException. Called by: " + this->where + ".";
44  }
45  else
46  {
47  ret = "CertificationException: " + CertificationException::errorCode2Message(this->errorCode) + ". Called by: " + this->where + ".";
48  }
49  return ret;
50  }
52  {
53  return this->errorCode;
54  }
56  {
57  std::string ret;
58  switch (errorCode)
59  {
61  ret = "Unknown error";
62  break;
64  ret = "Invalid certificate object";
65  break;
67  ret = "Invalid CRL object";
68  break;
70  ret = "Invalid extension";
71  break;
73  ret = "Set no value";
74  break;
76  ret = "Internal error";
77  break;
79  ret = "Unsupported asymmetric key type";
80  break;
82  ret = "Invalid type";
83  break;
85  ret = "Adding extension";
86  break;
88  ret = "Unknown OID";
89  break;
91  ret = "Known OID";
92  break;
93 // case CertificationException:::
94 // ret = "";
95 // break;
96 // case CertificationException:::
97 // ret = "";
98 // break;
99 // case CertificationException:::
100 // ret = "";
101 // break;
102  }
103  return ret;
104  }
105 
106 protected:
108 };
109 
110 #endif /*CERTIFICATIONEXCEPTION_H_*/
Definition: CertificationException.h:13
Definition: CertificationException.h:12
virtual ~CertificationException()
Definition: CertificationException.h:33
Definition: CertificationException.h:18
virtual CertificationException::ErrorCode getErrorCode()
Definition: CertificationException.h:51
CertificationException(CertificationException::ErrorCode errorCode, std::string where)
Definition: CertificationException.h:28
ErrorCode
Definition: CertificationException.h:9
Definition: CertificationException.h:20
Definition: CertificationException.h:11
Definition: CertificationException.h:6
Definition: CertificationException.h:14
virtual std::string toString() const
Definition: CertificationException.h:38
Definition: CertificationException.h:15
Definition: CertificationException.h:21
Definition: LibCryptoSecException.h:8
std::string where
Definition: LibCryptoSecException.h:23
CertificationException::ErrorCode errorCode
Definition: CertificationException.h:107
static std::string errorCode2Message(CertificationException::ErrorCode errorCode)
Definition: CertificationException.h:55
Definition: CertificationException.h:16
Definition: CertificationException.h:17
virtual std::string getMessage() const
Definition: CertificationException.h:34
Definition: CertificationException.h:19
CertificationException(std::string where)
Definition: CertificationException.h:23