diff --git a/src/ca-module.cpp b/src/ca-module.cpp
index 8b1c72a..0f1d800 100644
--- a/src/ca-module.cpp
+++ b/src/ca-module.cpp
@@ -184,41 +184,38 @@
   // PROBE Naming Convention: /<CA-Prefix>/CA/PROBE/[ParametersSha256DigestComponent]
   _LOG_TRACE("Received PROBE request");
 
-  // process PROBE requests: find an available name
-  std::string availableId = "";
-  const auto& parameterTLV = request.getApplicationParameters();
-  parameterTLV.parse();
-  if (!parameterTLV.hasValue()) {
-    _LOG_ERROR("Empty TLV obtained from the Interest parameter.");
-    return;
+  // process PROBE requests: collect probe parameters
+  auto parameters = PROBE::decodeApplicationParameters(request.getApplicationParameters());
+  std::vector<std::string> availableComponents;
+  if (m_config.m_nameAssignmentFunc) {
+    try {
+      availableComponents = m_config.m_nameAssignmentFunc(parameters);
+    }
+    catch (const std::exception& e) {
+      _LOG_TRACE("Cannot parse probe parameters: " << e.what());
+      m_face.put(generateErrorDataPacket(request.getName(), ErrorCode::INVALID_PARAMETER,
+                                         "Cannot parse probe parameters: " + std::string(e.what())));
+      return;
+    }
+  }
+  else {
+    // if there is no app-specified name lookup, use a random name id
+    availableComponents.push_back(std::to_string(random::generateSecureWord64()));
+  }
+  std::vector<Name> availableNames;
+  for (const auto& component : availableComponents) {
+    Name newIdentityName = m_config.m_caItem.m_caPrefix;
+    newIdentityName.append(component);
+    availableNames.push_back(newIdentityName);
   }
 
-  // if (m_config.m_caItem.m_nameAssignmentFunc) {
-  //   try {
-  //     availableId = m_config.m_caItem.m_nameAssignmentFunc(parameterTLV);
-  //   }
-  //   catch (const std::exception& e) {
-  //     _LOG_TRACE("Cannot find PROBE input from PROBE parameters: " << e.what());
-  //     return;
-  //   }
-  // }
-  // else {
-  //   // if there is no app-specified name lookup, use a random name id
-  //   availableId = std::to_string(random::generateSecureWord64());
-  // }
-  // Name newIdentityName = m_config.m_caItem.m_caPrefix;
-  // newIdentityName.append(availableId);
-  // _LOG_TRACE("Handle PROBE: generate an identity " << newIdentityName);
-
-  // Block contentTLV = PROBE::encodeDataContent(newIdentityName.toUri(), m_config.m_caItem.m_probe, parameterTLV);
-
-  // Data result;
-  // result.setName(request.getName());
-  // result.setContent(contentTLV);
-  // result.setFreshnessPeriod(DEFAULT_DATA_FRESHNESS_PERIOD);
-  // m_keyChain.sign(result, signingByIdentity(m_config.m_caItem.m_caPrefix));
-  // m_face.put(result);
-  // _LOG_TRACE("Handle PROBE: send out the PROBE response");
+  Data result;
+  result.setName(request.getName());
+  result.setContent(PROBE::encodeDataContent(availableNames, m_config.m_caItem.m_maxSuffixLength));
+  result.setFreshnessPeriod(DEFAULT_DATA_FRESHNESS_PERIOD);
+  m_keyChain.sign(result, signingByIdentity(m_config.m_caItem.m_caPrefix));
+  m_face.put(result);
+  _LOG_TRACE("Handle PROBE: send out the PROBE response");
 }
 
 void
diff --git a/src/client-module.cpp b/src/client-module.cpp
index 0e7810e..8fdb7b2 100644
--- a/src/client-module.cpp
+++ b/src/client-module.cpp
@@ -68,7 +68,7 @@
 ClientModule::verifyInfoResponse(const Data& reply)
 {
   // parse the ca item
-  auto caItem = INFO::decodeDataContentToCaProfile(reply.getContent());
+  auto caItem = INFO::decodeDataContent(reply.getContent());
 
   // verify the probe Data's sig
   if (!security::verifySignature(reply, *caItem.m_cert)) {
@@ -84,7 +84,7 @@
   const Block& contentBlock = reply.getContent();
 
   // parse the ca item
-  auto caItem = INFO::decodeDataContentToCaProfile(contentBlock);
+  auto caItem = INFO::decodeDataContent(contentBlock);
 
   // update the local config
   bool findItem = false;
diff --git a/src/protocol-detail/info.cpp b/src/protocol-detail/info.cpp
index da8b969..06eba0e 100644
--- a/src/protocol-detail/info.cpp
+++ b/src/protocol-detail/info.cpp
@@ -49,7 +49,7 @@
 }
 
 CaConfigItem
-INFO::decodeDataContentToCaProfile(const Block& block)
+INFO::decodeDataContent(const Block& block)
 {
   CaConfigItem result;
   block.parse();
diff --git a/src/protocol-detail/info.hpp b/src/protocol-detail/info.hpp
index 1c375bb..03f0d61 100644
--- a/src/protocol-detail/info.hpp
+++ b/src/protocol-detail/info.hpp
@@ -38,7 +38,7 @@
    * Decode CA configuration from the TLV block of INFO Data packet content.
    */
   static CaConfigItem
-  decodeDataContentToCaProfile(const Block& block);
+  decodeDataContent(const Block& block);
 };
 
 }  // namespace ndncert
diff --git a/src/protocol-detail/probe.cpp b/src/protocol-detail/probe.cpp
index 93ba020..c7b72d5 100644
--- a/src/protocol-detail/probe.cpp
+++ b/src/protocol-detail/probe.cpp
@@ -19,8 +19,9 @@
  */
 
 #include "probe.hpp"
-#include <ndn-cxx/encoding/tlv.hpp>
+
 #include <boost/throw_exception.hpp>
+#include <ndn-cxx/encoding/tlv.hpp>
 
 namespace ndn {
 namespace ndncert {
@@ -38,7 +39,19 @@
   return content;
 }
 
-// For CA
+std::vector<std::tuple<std::string, std::string>>
+PROBE::decodeApplicationParameters(const Block& block)
+{
+  std::vector<std::tuple<std::string, std::string>> result;
+  block.parse();
+  for (size_t i = 0; i < block.elements().size() - 1; ++i) {
+    if (block.elements().at(i).type() == tlv_parameter_key && block.elements().at(i + 1).type() == tlv_parameter_value) {
+      result.push_back(std::make_tuple(readString(block.elements().at(i)), readString(block.elements().at(i + 1))));
+    }
+  }
+  return result;
+}
+
 Block
 PROBE::encodeDataContent(const std::vector<Name>& identifiers, boost::optional<size_t> maxSuffixLength)
 {
@@ -53,5 +66,18 @@
   return content;
 }
 
+std::vector<Name>
+PROBE::decodeDataContent(const Block& block)
+{
+  std::vector<Name> result;
+  block.parse();
+  for (const auto& item : block.elements()) {
+    if (item.type() == tlv_probe_response) {
+      result.push_back(Name(item.blockFromValue()));
+    }
+  }
+  return result;
+}
+
 }  // namespace ndncert
 }  // namespace ndn
\ No newline at end of file
diff --git a/src/protocol-detail/probe.hpp b/src/protocol-detail/probe.hpp
index 126fba4..8d08e4b 100644
--- a/src/protocol-detail/probe.hpp
+++ b/src/protocol-detail/probe.hpp
@@ -28,11 +28,19 @@
 
 class PROBE {
 public:
+  // For CA use
   static Block
   encodeApplicationParameters(std::vector<std::tuple<std::string, std::string>>&& parameters);
 
+  static std::vector<Name>
+  decodeDataContent(const Block& block);
+
+  // For client use
   static Block
   encodeDataContent(const std::vector<Name>& identifiers, boost::optional<size_t> maxSuffixLength);
+
+  static std::vector<std::tuple<std::string, std::string>>
+  decodeApplicationParameters(const Block& block);
 };
 
 }  // namespace ndncert
