diff --git a/src/security/key-params.cpp b/src/security/key-params.cpp
index 546597c..a908b43 100644
--- a/src/security/key-params.cpp
+++ b/src/security/key-params.cpp
@@ -1,5 +1,5 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
+/*
  * Copyright (c) 2013-2017 Regents of the University of California.
  *
  * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
@@ -28,8 +28,6 @@
 static const uint32_t EC_KEY_SIZES[] = {256, 384};
 static const uint32_t AES_KEY_SIZES[] = {128, 192, 256};
 
-KeyParams::~KeyParams() = default;
-
 KeyParams::KeyParams(KeyType keyType, KeyIdType keyIdType)
   : m_keyType(keyType)
   , m_keyIdType(keyIdType)
@@ -45,11 +43,15 @@
   BOOST_ASSERT(!keyId.empty());
 }
 
+KeyParams::~KeyParams() = default;
+
+namespace detail {
+
 uint32_t
 RsaKeyParamsInfo::checkKeySize(uint32_t size)
 {
   if (size < MIN_RSA_KEY_SIZE)
-    BOOST_THROW_EXCEPTION(KeyParams::Error("Unsupported key size"));
+    BOOST_THROW_EXCEPTION(KeyParams::Error("Unsupported RSA key size"));
   return size;
 }
 
@@ -66,7 +68,7 @@
     if (EC_KEY_SIZES[i] == size)
       return size;
   }
-  BOOST_THROW_EXCEPTION(KeyParams::Error("Unsupported key size"));
+  BOOST_THROW_EXCEPTION(KeyParams::Error("Unsupported EC key size"));
 }
 
 uint32_t
@@ -75,7 +77,6 @@
   return EC_KEY_SIZES[0];
 }
 
-
 uint32_t
 AesKeyParamsInfo::checkKeySize(uint32_t size)
 {
@@ -83,7 +84,7 @@
     if (AES_KEY_SIZES[i] == size)
       return size;
   }
-  BOOST_THROW_EXCEPTION(KeyParams::Error("Unsupported key size"));
+  BOOST_THROW_EXCEPTION(KeyParams::Error("Unsupported AES key size"));
 }
 
 uint32_t
@@ -92,4 +93,5 @@
   return AES_KEY_SIZES[0];
 }
 
+} // namespace detail
 } // namespace ndn
diff --git a/src/security/key-params.hpp b/src/security/key-params.hpp
index 4c7d118..dce4908 100644
--- a/src/security/key-params.hpp
+++ b/src/security/key-params.hpp
@@ -1,5 +1,5 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
+/*
  * Copyright (c) 2013-2017 Regents of the University of California.
  *
  * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
@@ -22,9 +22,8 @@
 #ifndef NDN_SECURITY_KEY_PARAMS_HPP
 #define NDN_SECURITY_KEY_PARAMS_HPP
 
-#include "../common.hpp"
-#include "../name-component.hpp"
 #include "security-common.hpp"
+#include "../name-component.hpp"
 
 namespace ndn {
 
@@ -61,25 +60,25 @@
     return m_keyIdType;
   }
 
-  void
-  setKeyId(const name::Component& keyId)
-  {
-    m_keyId = keyId;
-  }
-
   const name::Component&
   getKeyId() const
   {
     return m_keyId;
   }
 
+  void
+  setKeyId(const name::Component& keyId)
+  {
+    m_keyId = keyId;
+  }
+
 protected:
   /**
    * @brief Create a key generation parameter
    *
    * @param keyType Type of the created key
    * @param keyIdType The method how the key id should be generated; must not be
-                      KeyIdType::USER_SPECIFIED
+   *                  KeyIdType::USER_SPECIFIED
    */
   KeyParams(KeyType keyType, KeyIdType keyIdType);
 
@@ -100,18 +99,20 @@
 };
 
 
-/// @brief RsaKeyParamInfo is used to initialize a SimplePublicKeyParams template for RSA key.
+namespace detail {
+
+/// @brief RsaKeyParamInfo is used to instantiate SimplePublicKeyParams for RSA keys.
 class RsaKeyParamsInfo
 {
 public:
-  static KeyType
+  static constexpr KeyType
   getType()
   {
     return KeyType::RSA;
   }
 
   /**
-   * @brief check if @p size is qualified.
+   * @brief check if @p size is valid and supported for this key type.
    *
    * @throw KeyParams::Error if the key size is not supported.
    */
@@ -122,18 +123,18 @@
   getDefaultSize();
 };
 
-/// @brief EcKeyParamInfo is used to initialize a SimplePublicKeyParams template for elliptic curve key.
+/// @brief EcKeyParamInfo is used to instantiate SimplePublicKeyParams for elliptic curve keys.
 class EcKeyParamsInfo
 {
 public:
-  static KeyType
+  static constexpr KeyType
   getType()
   {
     return KeyType::EC;
   }
 
   /**
-   * @brief check if @p size is qualified.
+   * @brief check if @p size is valid and supported for this key type.
    *
    * @throw KeyParams::Error if the key size is not supported.
    */
@@ -144,6 +145,8 @@
   getDefaultSize();
 };
 
+} // namespace detail
+
 
 /// @brief SimplePublicKeyParams is a template for public keys with only one parameter: size.
 template<typename KeyParamsInfo>
@@ -197,23 +200,26 @@
 };
 
 /// @brief RsaKeyParams carries parameters for RSA key.
-typedef SimplePublicKeyParams<RsaKeyParamsInfo> RsaKeyParams;
+typedef SimplePublicKeyParams<detail::RsaKeyParamsInfo> RsaKeyParams;
 
 /// @brief EcKeyParams carries parameters for EC key.
-typedef SimplePublicKeyParams<EcKeyParamsInfo> EcKeyParams;
+typedef SimplePublicKeyParams<detail::EcKeyParamsInfo> EcKeyParams;
 
-/// @brief AesKeyParamsInfo is used to initialize a SimpleSymmetricKeyParams template for AES key.
+
+namespace detail {
+
+/// @brief AesKeyParamsInfo is used to instantiate SimpleSymmetricKeyParams for AES keys.
 class AesKeyParamsInfo
 {
 public:
-  static KeyType
+  static constexpr KeyType
   getType()
   {
     return KeyType::AES;
   }
 
   /**
-   * @brief check if @p size is qualified.
+   * @brief check if @p size is valid and supported for this key type.
    *
    * @return KeyParams::Error if the key size is not supported.
    */
@@ -224,6 +230,9 @@
   getDefaultSize();
 };
 
+} // namespace detail
+
+
 /// @brief SimpleSymmetricKeyParams is a template for symmetric keys with only one parameter: size.
 template<typename KeyParamsInfo>
 class SimpleSymmetricKeyParams : public KeyParams
@@ -275,7 +284,8 @@
   uint32_t m_size;
 };
 
-typedef SimpleSymmetricKeyParams<AesKeyParamsInfo> AesKeyParams;
+/// @brief AesKeyParams carries parameters for AES key.
+typedef SimpleSymmetricKeyParams<detail::AesKeyParamsInfo> AesKeyParams;
 
 } // namespace ndn
 
diff --git a/tests/unit-tests/security/key-params.t.cpp b/tests/unit-tests/security/key-params.t.cpp
index 8903e46..46dea97 100644
--- a/tests/unit-tests/security/key-params.t.cpp
+++ b/tests/unit-tests/security/key-params.t.cpp
@@ -1,5 +1,5 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
+/*
  * Copyright (c) 2013-2017 Regents of the University of California.
  *
  * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
@@ -115,7 +115,6 @@
   BOOST_CHECK_EQUAL(boost::lexical_cast<std::string>(static_cast<KeyIdType>(12345)), "12345");
 }
 
-
 BOOST_AUTO_TEST_SUITE_END() // TestKeyParams
 BOOST_AUTO_TEST_SUITE_END() // Security
 
