security-exception.hpp
1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil -*- */
23 #ifndef NDN_SECURITY_EXCEPTION_HPP
24 #define NDN_SECURITY_EXCEPTION_HPP
25 
26 #include <exception>
27 #include <string>
28 
29 namespace ndn {
30 
31 class SecurityException : public std::exception {
32 public:
33  SecurityException(const std::string& errorMessage) throw();
34 
35  virtual ~SecurityException() throw();
36 
37  std::string Msg() { return errorMessage_; }
38 
39  virtual const char* what() const throw() { return errorMessage_.c_str(); }
40 
41 private:
42  const std::string errorMessage_;
43 };
44 
46 public:
47  UnrecognizedKeyFormatException(const std::string& errorMessage)
48  : SecurityException(errorMessage)
49  {
50  }
51 };
52 
54 public:
55  UnrecognizedDigestAlgorithmException(const std::string& errorMessage)
56  : SecurityException(errorMessage)
57  {
58  }
59 };
60 
61 }
62 
63 #endif
Definition: security-exception.hpp:31
Copyright (C) 2013-2016 Regents of the University of California.
Definition: common.hpp:35
Definition: security-exception.hpp:53
Definition: security-exception.hpp:45