Enhance exception throwing with Boost Exception library

Change-Id: I471023fc23ffaebe04d9668426b4c1b03e4962ba
Refs: #2997
diff --git a/src/security/key.cpp b/src/security/key.cpp
index dc430c7..48c8aa3 100644
--- a/src/security/key.cpp
+++ b/src/security/key.cpp
@@ -194,7 +194,7 @@
 Key::validityCheck() const
 {
   if (m_impl == nullptr)
-    throw std::domain_error("Invalid Key instance");
+    BOOST_THROW_EXCEPTION(std::domain_error("Invalid Key instance"));
 }
 
 } // namespace security