Enhance exception throwing with Boost Exception library

Change-Id: I471023fc23ffaebe04d9668426b4c1b03e4962ba
Refs: #2997
diff --git a/src/security/public-key.cpp b/src/security/public-key.cpp
index 07b8137..5e0a607 100644
--- a/src/security/public-key.cpp
+++ b/src/security/public-key.cpp
@@ -46,7 +46,7 @@
 PublicKey::computeDigest() const
 {
   if (m_key.empty())
-    throw Error("Public key is empty");
+    BOOST_THROW_EXCEPTION(Error("Public key is empty"));
 
   if (m_digest.hasWire())
     return m_digest;
@@ -110,8 +110,8 @@
           else if (algorithm == oid::ECDSA)
             m_type = KEY_TYPE_ECDSA;
           else
-            throw Error("Only RSA/ECDSA public keys are supported for now (" +
-                        algorithm.toString() + " requested)");
+            BOOST_THROW_EXCEPTION(Error("Only RSA/ECDSA public keys are supported for now (" +
+                                        algorithm.toString() + " requested)"));
         }
       }
 
@@ -120,7 +120,7 @@
   catch (CryptoPP::BERDecodeErr& err)
     {
       m_type = KEY_TYPE_NULL;
-      throw Error("PublicKey decoding error");
+      BOOST_THROW_EXCEPTION(Error("PublicKey decoding error"));
     }
 
   m_digest.reset();