security: Preliminary work with security module changes

Change-Id: I36d86ac22fdc8aa71eed229236673993753489a2
diff --git a/src/encoding/der/der-exception.hpp b/src/encoding/der/der-exception.hpp
index 1d0db2a..5016697 100644
--- a/src/encoding/der/der-exception.hpp
+++ b/src/encoding/der/der-exception.hpp
@@ -9,50 +9,20 @@
 #ifndef NDN_DER_EXCEPTION_HPP
 #define NDN_DER_EXCEPTION_HPP
 
-#include <exception>
+#include <stdexcept>
 #include <string>
 
 namespace ndn {
 
 namespace der {
 
-class DerException : public std::exception {
-public:
-  DerException(const std::string& errorMessage) throw();
-  
-  ~DerException() throw();
-  
-  std::string Msg() { return errorMessage_; }
-  
-  virtual const char* what() const throw() { return errorMessage_.c_str(); }
+struct DerException : public std::runtime_error { DerException(const std::string &msg) : std::runtime_error(msg) {} };
 
-private:
-  const std::string errorMessage_;
-};
+class NegativeLengthException : public DerException { NegativeLengthException(const std::string &msg) : DerException(msg) {} };
 
-class NegativeLengthException : public DerException
-{
-public:
-  NegativeLengthException(const std::string& errorMessage)
-  : DerException(errorMessage)
-  {}
-};
+class DerEncodingException : public DerException { DerEncodingException(const std::string &msg) : DerException(msg) {} };
 
-class DerEncodingException : public DerException
-{
-public:
-  DerEncodingException(const std::string& errorMessage)
-  : DerException(errorMessage)
-  {}
-};
-
-class DerDecodingException : public DerException
-{
-public:
-  DerDecodingException(const std::string& errorMessage)
-  : DerException(errorMessage)
-  {}
-};
+class DerDecodingException : public DerException { DerDecodingException(const std::string &msg) : DerException(msg) {} };
 
 } // der
 
diff --git a/src/security/certificate/identity-certificate.cpp b/src/security/certificate/identity-certificate.cpp
index 7e4bca7..7e6d50d 100644
--- a/src/security/certificate/identity-certificate.cpp
+++ b/src/security/certificate/identity-certificate.cpp
@@ -6,7 +6,6 @@
  * See COPYING for copyright and distribution information.
  */
 
-#include <ndn-cpp/security/security-exception.hpp>
 #include <ndn-cpp/security/certificate/identity-certificate.hpp>
 
 using namespace std;
@@ -17,17 +16,11 @@
   : Certificate(data)
 {
   if (!isCorrectName(data.getName()))
-    throw SecurityException("Wrong Identity Certificate Name!");
+    throw Error("Wrong Identity Certificate Name!");
   
   setPublicKeyName();
 }
 
-IdentityCertificate::IdentityCertificate(const IdentityCertificate& identityCertificate)
-  : Certificate(identityCertificate)
-  , publicKeyName_(identityCertificate.publicKeyName_)
-{
-}
-
 IdentityCertificate::~IdentityCertificate()
 {
 }
@@ -59,15 +52,14 @@
   return true;
 }
 
-Data& 
+void
 IdentityCertificate::setName(const Name& name)
 {
   if (!isCorrectName(name))
-    throw SecurityException("Wrong Identity Certificate Name!");
+    throw Error("Wrong Identity Certificate Name!");
   
   Data::setName(name);
   setPublicKeyName();
-  return *this;
 }
 
 void