Enhance exception throwing with Boost Exception library

Change-Id: I471023fc23ffaebe04d9668426b4c1b03e4962ba
Refs: #2997
diff --git a/src/security/key-params.hpp b/src/security/key-params.hpp
index d4840a2..1c911f4 100644
--- a/src/security/key-params.hpp
+++ b/src/security/key-params.hpp
@@ -128,7 +128,7 @@
   SimplePublicKeyParams(const KeyParams& params)
     : KeyParams(params.getKeyType())
   {
-    throw KeyParams::Error("Incorrect key parameters (incompatible key type)");
+    BOOST_THROW_EXCEPTION(KeyParams::Error("Incorrect key parameters (incompatible key type)"));
   }
 
   uint32_t
@@ -202,7 +202,7 @@
   explicit
   SimpleSymmetricKeyParams(const KeyParams& params)
   {
-    throw KeyParams::Error("Incorrect key parameters (incompatible key type)");
+    BOOST_THROW_EXCEPTION(KeyParams::Error("Incorrect key parameters (incompatible key type)"));
   }
 
   uint32_t