blob: 0a3d20c0b4715da98ad76c01e072844aef8d8dc8 [file] [log] [blame]
Jeff Thompsonc0573432013-09-19 17:41:36 -07001/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil -*- */
2/**
3 * Copyright (C) 2013 Regents of the University of California.
4 * @author: Yingdi Yu <yingdi@cs.ucla.edu>
5 * @author: Jeff Thompson <jefft0@remap.ucla.edu>
6 * See COPYING for copyright and distribution information.
7 */
8
9#ifndef NDN_SECURITY_EXCEPTION_HPP
10#define NDN_SECURITY_EXCEPTION_HPP
11
12#include <exception>
13#include <string>
14
15namespace ndn {
16
17class SecurityException : public std::exception {
18public:
19 SecurityException(const std::string& errorMessage) throw();
20
21 virtual ~SecurityException() throw();
22
23 inline std::string Msg() { return errorMessage_; }
24
25private:
26 const std::string errorMessage_;
27};
28
29class UnrecognizedKeyFormatException : public SecurityException {
30public:
31 UnrecognizedKeyFormatException(const std::string& errorMessage)
32 : SecurityException(errorMessage)
33 {
34 }
35};
36
37class UnrecognizedDigestAlgorithmException : public SecurityException {
38public:
39 UnrecognizedDigestAlgorithmException(const std::string& errorMessage)
40 : SecurityException(errorMessage)
41 {
42 }
43};
44
45}
46
47#endif