diff --git a/ca.conf.sample b/ca.conf.sample
index a4ec7df..977005a 100644
--- a/ca.conf.sample
+++ b/ca.conf.sample
@@ -10,7 +10,7 @@
   ]
   "supported-challenges":
   [
-    { "challenge": "PIN" },
-    { "challenge": "Email" }
+    { "challenge": "pin" },
+    { "challenge": "email" }
   ]
 }
diff --git a/src/ca-config.cpp b/src/ca-config.cpp
index 1bd8e04..e6ab0f6 100644
--- a/src/ca-config.cpp
+++ b/src/ca-config.cpp
@@ -58,6 +58,8 @@
   m_caInfo = configJson.get(CONFIG_CA_INFO, "");
   // CA max validity period
   m_maxValidityPeriod = time::seconds(configJson.get(CONFIG_MAX_VALIDITY_PERIOD, 3600));
+  // CA max suffix length
+  m_maxSuffixLength = configJson.get(CONFIG_MAX_SUFFIX_LENGTH, 1);
   // probe
   m_probeParameterKeys.clear();
   auto probeParameters = configJson.get_child_optional(CONFIG_PROBE_PARAMETERS);
diff --git a/src/ca-config.hpp b/src/ca-config.hpp
index e624e34..fbdfb24 100644
--- a/src/ca-config.hpp
+++ b/src/ca-config.hpp
@@ -21,9 +21,10 @@
 #ifndef NDNCERT_CA_CONFIG_HPP
 #define NDNCERT_CA_CONFIG_HPP
 
+#include <ndn-cxx/security/v2/certificate.hpp>
+
 #include "certificate-request.hpp"
 #include "client-config.hpp"
-#include <ndn-cxx/security/v2/certificate.hpp>
 
 namespace ndn {
 namespace ndncert {
@@ -59,6 +60,7 @@
  *  "ca-prefix": "",
  *  "ca-info": "",
  *  "max-validity-period": "",
+ *  "max-suffix-length": "",
  *  "probe-parameters":
  *  [
  *    {"probe-parameter-key": ""},
@@ -114,6 +116,11 @@
    */
   time::seconds m_maxValidityPeriod;
   /**
+   * Maximum allowed suffix length of requested name.
+   * E.g., When its value is 2, at most 2 name components can be assigned after m_caPrefix.
+   */
+  size_t m_maxSuffixLength;
+  /**
    * A list of supported challenges.
    */
   std::list<std::string> m_supportedChallenges;
diff --git a/src/ca-detail/ca-sqlite.cpp b/src/ca-detail/ca-sqlite.cpp
index 7d0444a..8312eaa 100644
--- a/src/ca-detail/ca-sqlite.cpp
+++ b/src/ca-detail/ca-sqlite.cpp
@@ -126,7 +126,7 @@
 
   if (statement.step() == SQLITE_ROW) {
     Name caName(statement.getBlock(2));
-    int status = statement.getInt(3);
+    Status status = static_cast<Status>(statement.getInt(3));
     std::string challengeStatus = statement.getString(4);
     security::v2::Certificate cert(statement.getBlock(6));
     std::string challengeType = statement.getString(7);
@@ -179,7 +179,7 @@
                              values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?))_SQLTEXT_");
     statement.bind(1, request.m_requestId, SQLITE_TRANSIENT);
     statement.bind(2, request.m_caPrefix.wireEncode(), SQLITE_TRANSIENT);
-    statement.bind(3, request.m_status);
+    statement.bind(3, static_cast<int>(request.m_status));
     statement.bind(4, request.m_challengeStatus, SQLITE_TRANSIENT);
     statement.bind(5, request.m_cert.getKeyName().wireEncode(),
                    SQLITE_TRANSIENT);
@@ -205,7 +205,7 @@
                              values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?))_SQLTEXT_");
     statement.bind(1, request.m_requestId, SQLITE_TRANSIENT);
     statement.bind(2, request.m_caPrefix.wireEncode(), SQLITE_TRANSIENT);
-    statement.bind(3, request.m_status);
+    statement.bind(3, static_cast<int>(request.m_status));
     statement.bind(4, request.m_challengeStatus, SQLITE_TRANSIENT);
     statement.bind(5, request.m_cert.getKeyName().wireEncode(),
                    SQLITE_TRANSIENT);
@@ -231,7 +231,7 @@
                              SET status = ?, challenge_status = ?, challenge_type = ?, challenge_secrets = ?,
                              challenge_tp = ?, remaining_tries = ?, remaining_time = ?, request_type = ?
                              WHERE request_id = ?)_SQLTEXT_");
-  statement.bind(1, request.m_status);
+  statement.bind(1, static_cast<int>(request.m_status));
   statement.bind(2, request.m_challengeStatus, SQLITE_TRANSIENT);
   statement.bind(3, request.m_challengeType, SQLITE_TRANSIENT);
   statement.bind(4, convertJson2String(request.m_challengeSecrets), SQLITE_TRANSIENT);
@@ -258,7 +258,7 @@
   while (statement.step() == SQLITE_ROW) {
     std::string requestId = statement.getString(1);
     Name caName(statement.getBlock(2));
-    int status = statement.getInt(3);
+    Status status = static_cast<Status>(statement.getInt(3));
     std::string challengeStatus = statement.getString(4);
     security::v2::Certificate cert(statement.getBlock(6));
     std::string challengeType = statement.getString(7);
@@ -289,7 +289,7 @@
   while (statement.step() == SQLITE_ROW) {
     std::string requestId = statement.getString(1);
     Name caName(statement.getBlock(2));
-    int status = statement.getInt(3);
+    Status status = static_cast<Status>(statement.getInt(3));
     std::string challengeStatus = statement.getString(4);
     security::v2::Certificate cert(statement.getBlock(6));
     std::string challengeType = statement.getString(7);
diff --git a/src/ca-module.cpp b/src/ca-module.cpp
index 47ab755..da087a0 100644
--- a/src/ca-module.cpp
+++ b/src/ca-module.cpp
@@ -343,7 +343,7 @@
 
   // create new request instance
   std::string requestId = std::to_string(random::generateWord64());
-  CertificateRequest certRequest(m_config.m_caPrefix, requestId, requestType, STATUS_BEFORE_CHALLENGE, *clientCert);
+  CertificateRequest certRequest(m_config.m_caPrefix, requestId, requestType, Status::BEFORE_CHALLENGE, *clientCert);
 
   try {
     m_storage->addRequest(certRequest);
@@ -416,7 +416,7 @@
 
   if (challenge == nullptr) {
     _LOG_TRACE("Unrecognized challenge type " << challengeType);
-    certRequest.m_status = STATUS_FAILURE;
+    certRequest.m_status = Status::FAILURE;
     certRequest.m_challengeStatus = CHALLENGE_STATUS_UNKNOWN_CHALLENGE;
     payload = CHALLENGE::encodeDataPayload(certRequest);
   }
@@ -424,18 +424,18 @@
     _LOG_TRACE("CHALLENGE module to be load: " << challengeType);
     // let challenge module handle the request
     challenge->handleChallengeRequest(paramTLV, certRequest);
-    if (certRequest.m_status == STATUS_FAILURE) {
+    if (certRequest.m_status == Status::FAILURE) {
       // if challenge failed
       m_storage->deleteRequest(certRequest.m_requestId);
       payload = CHALLENGE::encodeDataPayload(certRequest);
       _LOG_TRACE("Challenge failed");
     }
-    else if (certRequest.m_status == STATUS_PENDING) {
+    else if (certRequest.m_status == Status::PENDING) {
       // if challenge succeeded
       if (certRequest.m_requestType == REQUEST_TYPE_NEW) {
         auto issuedCert = issueCertificate(certRequest);
         certRequest.m_cert = issuedCert;
-        certRequest.m_status = STATUS_SUCCESS;
+        certRequest.m_status = Status::SUCCESS;
         try {
           m_storage->addCertificate(certRequest.m_requestId, issuedCert);
           m_storage->deleteRequest(certRequest.m_requestId);
@@ -455,7 +455,7 @@
         _LOG_TRACE("Challenge succeeded. Certificate has been issued");
       }
       else if (certRequest.m_requestType == REQUEST_TYPE_REVOKE) {
-        certRequest.m_status = STATUS_SUCCESS;
+        certRequest.m_status = Status::SUCCESS;
         try {
           m_storage->deleteRequest(certRequest.m_requestId);
           _LOG_TRACE("Certificate Revoked");
diff --git a/src/certificate-request.cpp b/src/certificate-request.cpp
index 4a4c4b4..b205531 100644
--- a/src/certificate-request.cpp
+++ b/src/certificate-request.cpp
@@ -26,31 +26,31 @@
 
 CertificateRequest::CertificateRequest() = default;
 
-CertificateRequest::CertificateRequest(const Name& caName, const std::string& requestId, int requestType, int status,
+CertificateRequest::CertificateRequest(const Name& caName, const std::string& requestId, int requestType, Status status,
                                        const security::v2::Certificate& cert)
-  : m_caPrefix(caName)
-  , m_requestId(requestId)
-  , m_requestType(requestType)
-  , m_status(status)
-  , m_cert(cert)
+    : m_caPrefix(caName)
+    , m_requestId(requestId)
+    , m_requestType(requestType)
+    , m_status(status)
+    , m_cert(cert)
 {
 }
 
-CertificateRequest::CertificateRequest(const Name& caName, const std::string& requestId, int requestType, int status,
+CertificateRequest::CertificateRequest(const Name& caName, const std::string& requestId, int requestType, Status status,
                                        const std::string& challengeStatus, const std::string& challengeType,
                                        const std::string& challengeTp, int remainingTime, int remainingTries,
                                        const JsonSection& challengeSecrets, const security::v2::Certificate& cert)
-  : m_caPrefix(caName)
-  , m_requestId(requestId)
-  , m_requestType(requestType)
-  , m_status(status)
-  , m_cert(cert)
-  , m_challengeStatus(challengeStatus)
-  , m_challengeType(challengeType)
-  , m_challengeTp(challengeTp)
-  , m_remainingTime(remainingTime)
-  , m_remainingTries(remainingTries)
-  , m_challengeSecrets(challengeSecrets)
+    : m_caPrefix(caName)
+    , m_requestId(requestId)
+    , m_requestType(requestType)
+    , m_status(status)
+    , m_cert(cert)
+    , m_challengeStatus(challengeStatus)
+    , m_challengeType(challengeType)
+    , m_challengeTp(challengeTp)
+    , m_remainingTime(remainingTime)
+    , m_remainingTries(remainingTries)
+    , m_challengeSecrets(challengeSecrets)
 {
 }
 
@@ -67,10 +67,8 @@
   os << "  " << request.m_caPrefix << "\n";
   os << "Request ID:\n";
   os << "  " << request.m_requestId << "\n";
-  if (request.m_status != -1) {
-    os << "Request Status:\n";
-    os << "  " << request.m_status << "\n";
-  }
+  os << "Request Status:\n";
+  os << "  " << statusToString(request.m_status) << "\n";
   if (request.m_challengeStatus != "") {
     os << "Challenge Status:\n";
     os << "  " << request.m_challengeStatus << "\n";
@@ -85,5 +83,5 @@
   return os;
 }
 
-} // namespace ndncert
-} // namespace ndn
+}  // namespace ndncert
+}  // namespace ndn
diff --git a/src/certificate-request.hpp b/src/certificate-request.hpp
index 4c067c5..bed7660 100644
--- a/src/certificate-request.hpp
+++ b/src/certificate-request.hpp
@@ -49,9 +49,9 @@
 {
 public:
   CertificateRequest();
-  CertificateRequest(const Name& caName, const std::string& requestId, int requestType, int status,
+  CertificateRequest(const Name& caName, const std::string& requestId, int requestType, Status status,
                      const security::v2::Certificate& cert);
-  CertificateRequest(const Name& caName, const std::string& requestId, int requestType, int status,
+  CertificateRequest(const Name& caName, const std::string& requestId, int requestType, Status status,
                      const std::string& challengeStatus, const std::string& challengeType,
                      const std::string& challengeTp, int remainingTime, int remainingTries,
                      const JsonSection& challengeSecrets, const security::v2::Certificate& cert);
@@ -63,7 +63,7 @@
   Name m_caPrefix;
   std::string m_requestId = "";
   int m_requestType = -1;
-  int m_status = -1;
+  Status m_status = Status::NOT_STARTED;
   security::v2::Certificate m_cert;
   std::shared_ptr<Data> m_probeToken = nullptr;
 
diff --git a/src/challenge-module.hpp b/src/challenge-module.hpp
index 4cc5fa9..fb687e1 100644
--- a/src/challenge-module.hpp
+++ b/src/challenge-module.hpp
@@ -70,13 +70,13 @@
 
   // For Client
   virtual JsonSection
-  getRequirementForChallenge(int status, const std::string& challengeStatus) = 0;
+  getRequirementForChallenge(Status status, const std::string& challengeStatus) = 0;
 
   virtual JsonSection
-  genChallengeRequestJson(int status, const std::string& challengeStatus, const JsonSection& params) = 0;
+  genChallengeRequestJson(Status status, const std::string& challengeStatus, const JsonSection& params) = 0;
 
   virtual Block
-  genChallengeRequestTLV(int status, const std::string& challengeStatus, const JsonSection& params) = 0;
+  genChallengeRequestTLV(Status status, const std::string& challengeStatus, const JsonSection& params) = 0;
 
   // helpers
   static std::string
diff --git a/src/challenge-module/challenge-credential.cpp b/src/challenge-module/challenge-credential.cpp
index 08131c1..da24fef 100644
--- a/src/challenge-module/challenge-credential.cpp
+++ b/src/challenge-module/challenge-credential.cpp
@@ -96,7 +96,7 @@
         credential = io::load<security::v2::Certificate>(ss);
         if (credential == nullptr) {
           _LOG_ERROR("Cannot load credential parameter: cert");
-          request.m_status = STATUS_FAILURE;
+          request.m_status = Status::FAILURE;
           request.m_challengeStatus = FAILURE_INVALID_FORMAT_CREDENTIAL;
           updateRequestOnChallengeEnd(request);
           return;
@@ -107,7 +107,7 @@
         selfSigned = io::load<security::v2::Certificate>(ss);
         if (selfSigned == nullptr) {
           _LOG_ERROR("Cannot load credential parameter: cert");
-          request.m_status = STATUS_FAILURE;
+          request.m_status = Status::FAILURE;
           request.m_challengeStatus = FAILURE_INVALID_FORMAT_SELF_SIGNED;
           updateRequestOnChallengeEnd(request);
           return;
@@ -126,7 +126,7 @@
       if (security::verifySignature(*selfSigned, anchor) &&
           security::verifySignature(*selfSigned, *credential) &&
           readString(selfSigned->getContent()) == request.m_requestId) {
-        request.m_status = STATUS_PENDING;
+        request.m_status = Status::PENDING;
         request.m_challengeStatus = CHALLENGE_STATUS_SUCCESS;
         updateRequestOnChallengeEnd(request);
         return;
@@ -135,7 +135,7 @@
   }
 
   _LOG_TRACE("Cannot verify the credential + self-signed Data + data content");
-  request.m_status = STATUS_FAILURE;
+  request.m_status = Status::FAILURE;
   request.m_challengeStatus = FAILURE_INVALID_CREDENTIAL;
   updateRequestOnChallengeEnd(request);
   return;
@@ -143,10 +143,10 @@
 
 // For Client
 JsonSection
-ChallengeCredential::getRequirementForChallenge(int status, const std::string& challengeStatus)
+ChallengeCredential::getRequirementForChallenge(Status status, const std::string& challengeStatus)
 {
   JsonSection result;
-  if (status == STATUS_BEFORE_CHALLENGE && challengeStatus == "") {
+  if (status == Status::BEFORE_CHALLENGE && challengeStatus == "") {
     result.put(JSON_CREDENTIAL_CERT, "Please_copy_anchor_signed_cert_here");
     result.put(JSON_PROOF_OF_PRIVATE_KEY, "Please_copy_key_signed_request_id_data_here");
   }
@@ -157,10 +157,10 @@
 }
 
 JsonSection
-ChallengeCredential::genChallengeRequestJson(int status, const std::string& challengeStatus, const JsonSection& params)
+ChallengeCredential::genChallengeRequestJson(Status status, const std::string& challengeStatus, const JsonSection& params)
 {
   JsonSection result;
-  if (status == STATUS_BEFORE_CHALLENGE && challengeStatus == "") {
+  if (status == Status::BEFORE_CHALLENGE && challengeStatus == "") {
     result.put(JSON_CREDENTIAL_CERT, params.get(JSON_CREDENTIAL_CERT, ""));
     result.put(JSON_PROOF_OF_PRIVATE_KEY, params.get(JSON_PROOF_OF_PRIVATE_KEY, ""));
   }
@@ -171,10 +171,10 @@
 }
 
 Block
-ChallengeCredential::genChallengeRequestTLV(int status, const std::string& challengeStatus, const JsonSection& params)
+ChallengeCredential::genChallengeRequestTLV(Status status, const std::string& challengeStatus, const JsonSection& params)
 {
   Block request = makeEmptyBlock(tlv_encrypted_payload);
-  if (status == STATUS_BEFORE_CHALLENGE && challengeStatus == "") {
+  if (status == Status::BEFORE_CHALLENGE && challengeStatus == "") {
     request.push_back(makeStringBlock(tlv_selected_challenge, CHALLENGE_TYPE));
     request.push_back(makeStringBlock(tlv_parameter_key, JSON_CREDENTIAL_CERT));
     request.push_back(makeStringBlock(tlv_parameter_value, params.get(JSON_CREDENTIAL_CERT, "")));
diff --git a/src/challenge-module/challenge-credential.hpp b/src/challenge-module/challenge-credential.hpp
index ad2b197..c0e0e48 100644
--- a/src/challenge-module/challenge-credential.hpp
+++ b/src/challenge-module/challenge-credential.hpp
@@ -57,13 +57,13 @@
 
   // For Client
   JsonSection
-  getRequirementForChallenge(int status, const std::string& challengeStatus) override;
+  getRequirementForChallenge(Status status, const std::string& challengeStatus) override;
 
   JsonSection
-  genChallengeRequestJson(int status, const std::string& challengeStatus, const JsonSection& params) override;
+  genChallengeRequestJson(Status status, const std::string& challengeStatus, const JsonSection& params) override;
 
   Block
-  genChallengeRequestTLV(int status, const std::string& challengeStatus, const JsonSection& params) override;
+  genChallengeRequestTLV(Status status, const std::string& challengeStatus, const JsonSection& params) override;
 
 PUBLIC_WITH_TESTS_ELSE_PRIVATE:
   void
diff --git a/src/challenge-module/challenge-email.cpp b/src/challenge-module/challenge-email.cpp
index c1e498a..cd08d9b 100644
--- a/src/challenge-module/challenge-email.cpp
+++ b/src/challenge-module/challenge-email.cpp
@@ -56,7 +56,7 @@
     // for the first time, init the challenge
     std::string emailAddress = readString(params.get(tlv_parameter_value));
     if (!isValidEmailAddress(emailAddress)) {
-      request.m_status = STATUS_FAILURE;
+      request.m_status = Status::FAILURE;
       request.m_challengeStatus = FAILURE_INVALID_EMAIL;
       return;
     }
@@ -74,7 +74,7 @@
         return;
       }
     }
-    request.m_status = STATUS_CHALLENGE;
+    request.m_status = Status::CHALLENGE;
     request.m_challengeStatus = NEED_CODE;
     request.m_challengeType = CHALLENGE_TYPE;
     std::string emailCode = generateSecretCode();
@@ -96,7 +96,7 @@
     const auto realCode = request.m_challengeSecrets.get<std::string>(JSON_CODE);
     if (currentTime - time::fromIsoString(request.m_challengeTp) >= m_secretLifetime) {
       // secret expires
-      request.m_status = STATUS_FAILURE;
+      request.m_status = Status::FAILURE;
       request.m_challengeStatus = CHALLENGE_STATUS_FAILURE_TIMEOUT;
       updateRequestOnChallengeEnd(request);
       _LOG_TRACE("Secret expired. Challenge failed.");
@@ -104,7 +104,7 @@
     }
     else if (givenCode == realCode) {
       // the code is correct
-      request.m_status = STATUS_PENDING;
+      request.m_status = Status::PENDING;
       request.m_challengeStatus = CHALLENGE_STATUS_SUCCESS;
       updateRequestOnChallengeEnd(request);
       _LOG_TRACE("Secret code matched. Challenge succeeded.");
@@ -122,7 +122,7 @@
       }
       else {
         // run out times
-        request.m_status = STATUS_FAILURE;
+        request.m_status = Status::FAILURE;
         request.m_challengeStatus = CHALLENGE_STATUS_FAILURE_MAXRETRY;
         updateRequestOnChallengeEnd(request);
         _LOG_TRACE("Secret code didn't match. Ran out tires. Challenge failed.");
@@ -132,23 +132,23 @@
   }
   else {
     _LOG_ERROR("The challenge status is wrong");
-    request.m_status = STATUS_FAILURE;
+    request.m_status = Status::FAILURE;
     return;
   }
 }
 
 // For Client
 JsonSection
-ChallengeEmail::getRequirementForChallenge(int status, const std::string& challengeStatus)
+ChallengeEmail::getRequirementForChallenge(Status status, const std::string& challengeStatus)
 {
   JsonSection result;
-  if (status == STATUS_BEFORE_CHALLENGE && challengeStatus == "") {
+  if (status == Status::BEFORE_CHALLENGE && challengeStatus == "") {
     result.put(JSON_EMAIL, "Please_input_your_email_address");
   }
-  else if (status == STATUS_CHALLENGE && challengeStatus == NEED_CODE) {
+  else if (status == Status::CHALLENGE && challengeStatus == NEED_CODE) {
     result.put(JSON_CODE, "Please_input_your_verification_code");
   }
-  else if (status == STATUS_CHALLENGE && challengeStatus == WRONG_CODE) {
+  else if (status == Status::CHALLENGE && challengeStatus == WRONG_CODE) {
     result.put(JSON_CODE, "Incorrect_code_please_try_again");
   }
   else {
@@ -158,18 +158,18 @@
 }
 
 JsonSection
-ChallengeEmail::genChallengeRequestJson(int status, const std::string& challengeStatus, const JsonSection& params)
+ChallengeEmail::genChallengeRequestJson(Status status, const std::string& challengeStatus, const JsonSection& params)
 {
   JsonSection result;
-  if (status == STATUS_BEFORE_CHALLENGE && challengeStatus == "") {
+  if (status == Status::BEFORE_CHALLENGE && challengeStatus == "") {
     result.put(JSON_CLIENT_SELECTED_CHALLENGE, CHALLENGE_TYPE);
     result.put(JSON_EMAIL, params.get(JSON_EMAIL, ""));
   }
-  else if (status == STATUS_CHALLENGE && challengeStatus == NEED_CODE) {
+  else if (status == Status::CHALLENGE && challengeStatus == NEED_CODE) {
     result.put(JSON_CLIENT_SELECTED_CHALLENGE, CHALLENGE_TYPE);
     result.put(JSON_CODE, params.get(JSON_CODE, ""));
   }
-  else if (status == STATUS_CHALLENGE && challengeStatus == WRONG_CODE) {
+  else if (status == Status::CHALLENGE && challengeStatus == WRONG_CODE) {
     result.put(JSON_CLIENT_SELECTED_CHALLENGE, CHALLENGE_TYPE);
     result.put(JSON_CODE, params.get(JSON_CODE, ""));
   }
@@ -180,20 +180,20 @@
 }
 
 Block
-ChallengeEmail::genChallengeRequestTLV(int status, const std::string& challengeStatus, const JsonSection& params)
+ChallengeEmail::genChallengeRequestTLV(Status status, const std::string& challengeStatus, const JsonSection& params)
 {
   Block request = makeEmptyBlock(tlv_encrypted_payload);
-  if (status == STATUS_BEFORE_CHALLENGE && challengeStatus == "") {
+  if (status == Status::BEFORE_CHALLENGE && challengeStatus == "") {
     request.push_back(makeStringBlock(tlv_selected_challenge, CHALLENGE_TYPE));
     request.push_back(makeStringBlock(tlv_parameter_key, JSON_EMAIL));
     request.push_back(makeStringBlock(tlv_parameter_value, params.get(JSON_EMAIL,"")));
   }
-  else if (status == STATUS_CHALLENGE && challengeStatus == NEED_CODE) {
+  else if (status == Status::CHALLENGE && challengeStatus == NEED_CODE) {
     request.push_back(makeStringBlock(tlv_selected_challenge, CHALLENGE_TYPE));
     request.push_back(makeStringBlock(tlv_parameter_key, JSON_CODE));
     request.push_back(makeStringBlock(tlv_parameter_value, params.get(JSON_CODE,"")));
   }
-  else if (status == STATUS_CHALLENGE && challengeStatus == WRONG_CODE) {
+  else if (status == Status::CHALLENGE && challengeStatus == WRONG_CODE) {
     request.push_back(makeStringBlock(tlv_selected_challenge, CHALLENGE_TYPE));
     request.push_back(makeStringBlock(tlv_parameter_key, JSON_CODE));
     request.push_back(makeStringBlock(tlv_parameter_value, params.get(JSON_CODE,"")));
diff --git a/src/challenge-module/challenge-email.hpp b/src/challenge-module/challenge-email.hpp
index 4421bd3..b43a3de 100644
--- a/src/challenge-module/challenge-email.hpp
+++ b/src/challenge-module/challenge-email.hpp
@@ -63,13 +63,13 @@
 
   // For Client
   JsonSection
-  getRequirementForChallenge(int status, const std::string& challengeStatus) override;
+  getRequirementForChallenge(Status status, const std::string& challengeStatus) override;
 
   JsonSection
-  genChallengeRequestJson(int status, const std::string& challengeStatus, const JsonSection& params) override;
+  genChallengeRequestJson(Status status, const std::string& challengeStatus, const JsonSection& params) override;
 
   Block
-  genChallengeRequestTLV(int status, const std::string& challengeStatus, const JsonSection& params) override;
+  genChallengeRequestTLV(Status status, const std::string& challengeStatus, const JsonSection& params) override;
 
 PUBLIC_WITH_TESTS_ELSE_PRIVATE:
   static bool
diff --git a/src/challenge-module/challenge-pin.cpp b/src/challenge-module/challenge-pin.cpp
index e809213..55b9435 100644
--- a/src/challenge-module/challenge-pin.cpp
+++ b/src/challenge-module/challenge-pin.cpp
@@ -49,7 +49,7 @@
   if (request.m_challengeStatus == "") {
     _LOG_TRACE("Challenge Interest arrives. Init the challenge");
     // for the first time, init the challenge
-    request.m_status = STATUS_CHALLENGE;
+    request.m_status = Status::CHALLENGE;
     request.m_challengeStatus = NEED_CODE;
     request.m_challengeType = CHALLENGE_TYPE;
     std::string secretCode = generateSecretCode();
@@ -69,7 +69,7 @@
     const auto realCode = request.m_challengeSecrets.get<std::string>(JSON_PIN_CODE);
     if (currentTime - time::fromIsoString(request.m_challengeTp) >= m_secretLifetime) {
       // secret expires
-      request.m_status = STATUS_FAILURE;
+      request.m_status = Status::FAILURE;
       request.m_challengeStatus = CHALLENGE_STATUS_FAILURE_TIMEOUT;
       updateRequestOnChallengeEnd(request);
       _LOG_TRACE("Secret expired. Challenge failed.");
@@ -77,7 +77,7 @@
     }
     else if (givenCode == realCode) {
       // the code is correct
-      request.m_status = STATUS_PENDING;
+      request.m_status = Status::PENDING;
       request.m_challengeStatus = CHALLENGE_STATUS_SUCCESS;
       updateRequestOnChallengeEnd(request);
       _LOG_TRACE("PIN code matched. Challenge succeeded.");
@@ -95,7 +95,7 @@
       }
       else {
         // run out times
-        request.m_status = STATUS_FAILURE;
+        request.m_status = Status::FAILURE;
         request.m_challengeStatus = CHALLENGE_STATUS_FAILURE_MAXRETRY;
         updateRequestOnChallengeEnd(request);
         _LOG_TRACE("PIN code didn't match. Ran out tires. Challenge failed.");
@@ -105,23 +105,23 @@
   }
   else {
     _LOG_ERROR("The challenge status is wrong");
-    request.m_status = STATUS_FAILURE;
+    request.m_status = Status::FAILURE;
     return;
   }
 }
 
 // For Client
 JsonSection
-ChallengePin::getRequirementForChallenge(int status, const std::string& challengeStatus)
+ChallengePin::getRequirementForChallenge(Status status, const std::string& challengeStatus)
 {
   JsonSection result;
-  if (status == STATUS_BEFORE_CHALLENGE && challengeStatus == "") {
+  if (status == Status::BEFORE_CHALLENGE && challengeStatus == "") {
     // do nothing
   }
-  else if (status == STATUS_CHALLENGE && challengeStatus == NEED_CODE) {
+  else if (status == Status::CHALLENGE && challengeStatus == NEED_CODE) {
     result.put(JSON_PIN_CODE, "Please_input_your_verification_code");
   }
-  else if (status == STATUS_CHALLENGE && challengeStatus == WRONG_CODE) {
+  else if (status == Status::CHALLENGE && challengeStatus == WRONG_CODE) {
     result.put(JSON_PIN_CODE, "Incorrect_PIN_code_please_try_again");
   }
   else {
@@ -131,18 +131,18 @@
 }
 
 JsonSection
-ChallengePin::genChallengeRequestJson(int status, const std::string& challengeStatus, const JsonSection& params)
+ChallengePin::genChallengeRequestJson(Status status, const std::string& challengeStatus, const JsonSection& params)
 {
   JsonSection result;
-  if (status == STATUS_BEFORE_CHALLENGE && challengeStatus == "") {
+  if (status == Status::BEFORE_CHALLENGE && challengeStatus == "") {
     // do nothing
     result.put(JSON_CLIENT_SELECTED_CHALLENGE, CHALLENGE_TYPE);
   }
-  else if (status == STATUS_CHALLENGE && challengeStatus == NEED_CODE) {
+  else if (status == Status::CHALLENGE && challengeStatus == NEED_CODE) {
     result.put(JSON_CLIENT_SELECTED_CHALLENGE, CHALLENGE_TYPE);
     result.put(JSON_PIN_CODE, params.get(JSON_PIN_CODE, ""));
   }
-  else if (status == STATUS_CHALLENGE && challengeStatus == WRONG_CODE) {
+  else if (status == Status::CHALLENGE && challengeStatus == WRONG_CODE) {
     result.put(JSON_CLIENT_SELECTED_CHALLENGE, CHALLENGE_TYPE);
     result.put(JSON_PIN_CODE, params.get(JSON_PIN_CODE, ""));
   }
@@ -153,19 +153,19 @@
 }
 
 Block
-ChallengePin::genChallengeRequestTLV(int status, const std::string& challengeStatus, const JsonSection& params)
+ChallengePin::genChallengeRequestTLV(Status status, const std::string& challengeStatus, const JsonSection& params)
 {
   Block request = makeEmptyBlock(tlv_encrypted_payload);
-  if (status == STATUS_BEFORE_CHALLENGE && challengeStatus == "") {
+  if (status == Status::BEFORE_CHALLENGE && challengeStatus == "") {
     // do nothing
     request.push_back(makeStringBlock(tlv_selected_challenge, CHALLENGE_TYPE));
   }
-  else if (status == STATUS_CHALLENGE && challengeStatus == NEED_CODE) {
+  else if (status == Status::CHALLENGE && challengeStatus == NEED_CODE) {
     request.push_back(makeStringBlock(tlv_selected_challenge, CHALLENGE_TYPE));
     request.push_back(makeStringBlock(tlv_parameter_key, JSON_PIN_CODE));
     request.push_back(makeStringBlock(tlv_parameter_value, params.get(JSON_PIN_CODE,"")));
   }
-  else if (status == STATUS_CHALLENGE && challengeStatus == WRONG_CODE) {
+  else if (status == Status::CHALLENGE && challengeStatus == WRONG_CODE) {
     request.push_back(makeStringBlock(tlv_selected_challenge, CHALLENGE_TYPE));
     request.push_back(makeStringBlock(tlv_parameter_key, JSON_PIN_CODE));
     request.push_back(makeStringBlock(tlv_parameter_value, params.get(JSON_PIN_CODE,"")));
diff --git a/src/challenge-module/challenge-pin.hpp b/src/challenge-module/challenge-pin.hpp
index 7ae1d75..44db7d8 100644
--- a/src/challenge-module/challenge-pin.hpp
+++ b/src/challenge-module/challenge-pin.hpp
@@ -57,13 +57,13 @@
 
   // For Client
   JsonSection
-  getRequirementForChallenge(int status, const std::string& challengeStatus) override;
+  getRequirementForChallenge(Status status, const std::string& challengeStatus) override;
 
   JsonSection
-  genChallengeRequestJson(int status, const std::string& challengeStatus, const JsonSection& params) override;
+  genChallengeRequestJson(Status status, const std::string& challengeStatus, const JsonSection& params) override;
 
   Block
-  genChallengeRequestTLV(int status, const std::string& challengeStatus, const JsonSection& params) override;
+  genChallengeRequestTLV(Status status, const std::string& challengeStatus, const JsonSection& params) override;
 
 
 PUBLIC_WITH_TESTS_ELSE_PRIVATE:
diff --git a/src/challenge-module/challenge-private-key.cpp b/src/challenge-module/challenge-private-key.cpp
index 0b77af9..74af413 100644
--- a/src/challenge-module/challenge-private-key.cpp
+++ b/src/challenge-module/challenge-private-key.cpp
@@ -48,7 +48,7 @@
 {
   if (request.m_requestType == REQUEST_TYPE_NEW) {
       _LOG_TRACE("Cannot use this private key challenge for new certificate request");
-      request.m_status = STATUS_FAILURE;
+      request.m_status = Status::FAILURE;
       request.m_challengeStatus = FAILURE_INVALID_REQUEST_TYPE;
       updateRequestOnChallengeEnd(request);
   }
@@ -62,7 +62,7 @@
         selfSigned = io::load<security::v2::Certificate>(ss);
         if (selfSigned == nullptr) {
           _LOG_ERROR("Cannot load credential parameter: cert");
-          request.m_status = STATUS_FAILURE;
+          request.m_status = Status::FAILURE;
           request.m_challengeStatus = FAILURE_INVALID_FORMAT_SELF_SIGNED;
           updateRequestOnChallengeEnd(request);
           return;
@@ -77,24 +77,24 @@
   // verify the credential and the self-signed cert
   if (security::verifySignature(*selfSigned, request.m_cert) &&
     readString(selfSigned->getContent()) == request.m_requestId) {
-    request.m_status = STATUS_PENDING;
+    request.m_status = Status::PENDING;
     request.m_challengeStatus = CHALLENGE_STATUS_SUCCESS;
     updateRequestOnChallengeEnd(request);
     return;
   }
 
   _LOG_TRACE("Cannot verify the credential + self-signed Data + data content");
-  request.m_status = STATUS_FAILURE;
+  request.m_status = Status::FAILURE;
   request.m_challengeStatus = FAILURE_INVALID_CREDENTIAL;
   updateRequestOnChallengeEnd(request);
 }
 
 // For Client
 JsonSection
-ChallengePrivateKey::getRequirementForChallenge(int status, const std::string& challengeStatus)
+ChallengePrivateKey::getRequirementForChallenge(Status status, const std::string& challengeStatus)
 {
   JsonSection result;
-  if (status == STATUS_BEFORE_CHALLENGE && challengeStatus == "") {
+  if (status == Status::BEFORE_CHALLENGE && challengeStatus == "") {
     result.put(JSON_PROOF_OF_PRIVATE_KEY, "Please_copy_key_signed_request_id_data_here");
   }
   else {
@@ -104,10 +104,10 @@
 }
 
 JsonSection
-ChallengePrivateKey::genChallengeRequestJson(int status, const std::string& challengeStatus, const JsonSection& params)
+ChallengePrivateKey::genChallengeRequestJson(Status status, const std::string& challengeStatus, const JsonSection& params)
 {
   JsonSection result;
-  if (status == STATUS_BEFORE_CHALLENGE && challengeStatus == "") {
+  if (status == Status::BEFORE_CHALLENGE && challengeStatus == "") {
     result.put(JSON_PROOF_OF_PRIVATE_KEY, params.get(JSON_PROOF_OF_PRIVATE_KEY, ""));
   }
   else {
@@ -117,10 +117,10 @@
 }
 
 Block
-ChallengePrivateKey::genChallengeRequestTLV(int status, const std::string& challengeStatus, const JsonSection& params)
+ChallengePrivateKey::genChallengeRequestTLV(Status status, const std::string& challengeStatus, const JsonSection& params)
 {
   Block request = makeEmptyBlock(tlv_encrypted_payload);
-  if (status == STATUS_BEFORE_CHALLENGE && challengeStatus == "") {
+  if (status == Status::BEFORE_CHALLENGE && challengeStatus == "") {
     request.push_back(makeStringBlock(tlv_selected_challenge, CHALLENGE_TYPE));
     request.push_back(makeStringBlock(tlv_parameter_key, JSON_PROOF_OF_PRIVATE_KEY));
     request.push_back(makeStringBlock(tlv_parameter_value, params.get(JSON_PROOF_OF_PRIVATE_KEY, "")));
diff --git a/src/challenge-module/challenge-private-key.hpp b/src/challenge-module/challenge-private-key.hpp
index 8e78d5a..5f0b936 100644
--- a/src/challenge-module/challenge-private-key.hpp
+++ b/src/challenge-module/challenge-private-key.hpp
@@ -54,13 +54,13 @@
 
   // For Client
   JsonSection
-  getRequirementForChallenge(int status, const std::string& challengeStatus) override;
+  getRequirementForChallenge(Status status, const std::string& challengeStatus) override;
 
   JsonSection
-  genChallengeRequestJson(int status, const std::string& challengeStatus, const JsonSection& params) override;
+  genChallengeRequestJson(Status status, const std::string& challengeStatus, const JsonSection& params) override;
 
   Block
-  genChallengeRequestTLV(int status, const std::string& challengeStatus, const JsonSection& params) override;
+  genChallengeRequestTLV(Status status, const std::string& challengeStatus, const JsonSection& params) override;
 
 PUBLIC_WITH_TESTS_ELSE_PRIVATE:
   static const std::string FAILURE_INVALID_REQUEST_TYPE;
diff --git a/src/client-module.cpp b/src/client-module.cpp
index 52cb62c..6ebe9d7 100644
--- a/src/client-module.cpp
+++ b/src/client-module.cpp
@@ -19,21 +19,23 @@
  */
 
 #include "client-module.hpp"
-#include "logging.hpp"
-#include "challenge-module.hpp"
-#include "crypto-support/enc-tlv.hpp"
-#include "protocol-detail/info.hpp"
-#include "protocol-detail/probe.hpp"
-#include "protocol-detail/new.hpp"
-#include "protocol-detail/challenge.hpp"
-#include "protocol-detail/revoke.hpp"
-#include <ndn-cxx/util/io.hpp>
+
 #include <ndn-cxx/security/signing-helpers.hpp>
-#include <ndn-cxx/security/verification-helpers.hpp>
-#include <ndn-cxx/util/random.hpp>
 #include <ndn-cxx/security/transform/base64-encode.hpp>
 #include <ndn-cxx/security/transform/buffer-source.hpp>
 #include <ndn-cxx/security/transform/stream-sink.hpp>
+#include <ndn-cxx/security/verification-helpers.hpp>
+#include <ndn-cxx/util/io.hpp>
+#include <ndn-cxx/util/random.hpp>
+
+#include "challenge-module.hpp"
+#include "crypto-support/enc-tlv.hpp"
+#include "logging.hpp"
+#include "protocol-detail/challenge.hpp"
+#include "protocol-detail/info.hpp"
+#include "protocol-detail/new.hpp"
+#include "protocol-detail/probe.hpp"
+#include "protocol-detail/revoke.hpp"
 
 namespace ndn {
 namespace ndncert {
@@ -41,7 +43,7 @@
 _LOG_INIT(ndncert.client);
 
 ClientModule::ClientModule(security::v2::KeyChain& keyChain)
-  : m_keyChain(keyChain)
+    : m_keyChain(keyChain)
 {
 }
 
@@ -107,8 +109,7 @@
   interest->setMustBeFresh(true);
   interest->setCanBePrefix(false);
   interest->setApplicationParameters(
-    PROBE::encodeApplicationParametersFromProbeInfo(ca, probeInfo)
-  );
+      PROBE::encodeApplicationParametersFromProbeInfo(ca, probeInfo));
 
   // update local state
   m_ca = ca;
@@ -143,7 +144,7 @@
                                   const Name& identityName, const shared_ptr<Data>& probeToken)
 {
   // Name requestedName = identityName;
-  if (!identityName.empty()) { // if identityName is not empty, find the corresponding CA
+  if (!identityName.empty()) {  // if identityName is not empty, find the corresponding CA
     bool findCa = false;
     for (const auto& caItem : m_config.m_caItems) {
       if (caItem.m_caPrefix.isPrefixOf(identityName)) {
@@ -151,12 +152,12 @@
         findCa = true;
       }
     }
-    if (!findCa) { // if cannot find, cannot proceed
+    if (!findCa) {  // if cannot find, cannot proceed
       return nullptr;
     }
     m_identityName = identityName;
   }
-  else { // if identityName is empty, check m_identityName or generate a random name
+  else {  // if identityName is empty, check m_identityName or generate a random name
     if (!m_identityName.empty()) {
       // do nothing
     }
@@ -203,8 +204,7 @@
   interest->setMustBeFresh(true);
   interest->setCanBePrefix(false);
   interest->setApplicationParameters(
-    NEW::encodeApplicationParameters(m_ecdh.getBase64PubKey(), certRequest, probeToken)
-  );
+      NEW::encodeApplicationParameters(m_ecdh.getBase64PubKey(), certRequest, probeToken));
 
   // sign the Interest packet
   m_keyChain.sign(*interest, signingByKey(m_key.getName()));
@@ -214,7 +214,7 @@
 std::list<std::string>
 ClientModule::onNewResponse(const Data& reply)
 {
-    return onRequestInitResponse(reply, REQUEST_TYPE_NEW);
+  return onRequestInitResponse(reply, REQUEST_TYPE_NEW);
 }
 
 std::list<std::string>
@@ -228,7 +228,7 @@
   contentTLV.parse();
 
   // ECDH
-  const auto& peerKeyBase64Str = readString(contentTLV.get(tlv_ecdh_pub));  
+  const auto& peerKeyBase64Str = readString(contentTLV.get(tlv_ecdh_pub));
   const auto& saltStr = readString(contentTLV.get(tlv_salt));
   uint64_t saltInt = std::stoull(saltStr);
   m_ecdh.deriveSecret(peerKeyBase64Str);
@@ -238,7 +238,7 @@
        (uint8_t*)&saltInt, sizeof(saltInt), m_aesKey, sizeof(m_aesKey));
 
   // update state
-  m_status = readNonNegativeInteger(contentTLV.get(tlv_status));
+  m_status = static_cast<Status>(readNonNegativeInteger(contentTLV.get(tlv_status)));
   m_requestId = readString(contentTLV.get(tlv_request_id));
   m_challengeList.clear();
   for (auto const& element : contentTLV.elements()) {
@@ -252,37 +252,36 @@
 shared_ptr<Interest>
 ClientModule::generateRevokeInterest(const security::v2::Certificate& certificate)
 {
-    // Name requestedName = identityName;
-    bool findCa = false;
-    for (const auto& caItem : m_config.m_caItems) {
-        if (caItem.m_caName.isPrefixOf(certificate.getName())) {
-            m_ca = caItem;
-            findCa = true;
-        }
+  // Name requestedName = identityName;
+  bool findCa = false;
+  for (const auto& caItem : m_config.m_caItems) {
+    if (caItem.m_caName.isPrefixOf(certificate.getName())) {
+      m_ca = caItem;
+      findCa = true;
     }
-    if (!findCa) { // if cannot find, cannot proceed
-        _LOG_TRACE("Cannot find corresponding CA for the certificate.");
-        return nullptr;
-    }
+  }
+  if (!findCa) {  // if cannot find, cannot proceed
+    _LOG_TRACE("Cannot find corresponding CA for the certificate.");
+    return nullptr;
+  }
 
-    // generate Interest packet
-    Name interestName = m_ca.m_caPrefix;
-    interestName.append("CA").append("REVOKE");
-    auto interest = make_shared<Interest>(interestName);
-    interest->setMustBeFresh(true);
-    interest->setCanBePrefix(false);
-    interest->setApplicationParameters(
-            REVOKE::encodeApplicationParameters(m_ecdh.getBase64PubKey(), certificate)
-    );
+  // generate Interest packet
+  Name interestName = m_ca.m_caPrefix;
+  interestName.append("CA").append("REVOKE");
+  auto interest = make_shared<Interest>(interestName);
+  interest->setMustBeFresh(true);
+  interest->setCanBePrefix(false);
+  interest->setApplicationParameters(
+      REVOKE::encodeApplicationParameters(m_ecdh.getBase64PubKey(), certificate));
 
-    // return the Interest packet
-    return interest;
+  // return the Interest packet
+  return interest;
 }
 
 std::list<std::string>
 ClientModule::onRevokeResponse(const Data& reply)
 {
-    return onRequestInitResponse(reply, REQUEST_TYPE_REVOKE);
+  return onRequestInitResponse(reply, REQUEST_TYPE_REVOKE);
 }
 
 shared_ptr<Interest>
@@ -299,7 +298,8 @@
 
   // encrypt the Interest parameters
   auto paramBlock = encodeBlockWithAesGcm128(tlv::ApplicationParameters, m_aesKey,
-                                             challengeRequest.value(), challengeRequest.value_size(), (const uint8_t*)"test", strlen("test"));
+                                             challengeRequest.value(), challengeRequest.value_size(),
+                                             (const uint8_t*)"test", strlen("test"));
   interest->setApplicationParameters(paramBlock);
 
   m_keyChain.sign(*interest, signingByKey(m_key.getName()));
@@ -319,7 +319,7 @@
   contentTLV.parse();
 
   // update state
-  m_status = readNonNegativeInteger(contentTLV.get(tlv_status));
+  m_status = static_cast<Status>(readNonNegativeInteger(contentTLV.get(tlv_status)));
   m_challengeStatus = readString(contentTLV.get(tlv_challenge_status));
   m_remainingTries = readNonNegativeInteger(contentTLV.get(tlv_remaining_tries));
   m_freshBefore = time::system_clock::now() +
@@ -370,7 +370,7 @@
 void
 ClientModule::endSession()
 {
-  if (getApplicationStatus() == STATUS_SUCCESS || getApplicationStatus() == STATUS_ENDED) {
+  if (getApplicationStatus() == Status::SUCCESS || getApplicationStatus() == Status::ENDED) {
     return;
   }
   if (m_isNewlyCreatedIdentity) {
@@ -383,10 +383,9 @@
     auto identity = m_keyChain.getPib().getIdentity(m_identityName);
     m_keyChain.deleteKey(identity, m_key);
   }
-  m_status = STATUS_ENDED;
+  m_status = Status::ENDED;
 }
 
-
 std::vector<std::string>
 ClientModule::parseProbeComponents(const std::string& probe)
 {
@@ -402,5 +401,5 @@
   return components;
 }
 
-} // namespace ndncert
-} // namespace ndn
+}  // namespace ndncert
+}  // namespace ndn
diff --git a/src/client-module.hpp b/src/client-module.hpp
index eefccad..f90cff3 100644
--- a/src/client-module.hpp
+++ b/src/client-module.hpp
@@ -55,7 +55,7 @@
     return m_config;
   }
 
-  int
+  Status
   getApplicationStatus() const
   {
     return m_status;
@@ -135,7 +135,7 @@
   Name m_identityName;
 
   std::string m_requestId = "";
-  int m_status = STATUS_NOT_STARTED;
+  Status m_status = Status::NOT_STARTED;
   std::string m_challengeStatus = "";
   std::string m_challengeType = "";
   std::string m_certId = "";
diff --git a/src/ndncert-common.cpp b/src/ndncert-common.cpp
new file mode 100644
index 0000000..0a6c994
--- /dev/null
+++ b/src/ndncert-common.cpp
@@ -0,0 +1,49 @@
+/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
+/**
+ * Copyright (c) 2017-2020, Regents of the University of California.
+ *
+ * This file is part of ndncert, a certificate management system based on NDN.
+ *
+ * ndncert is free software: you can redistribute it and/or modify it under the terms
+ * of the GNU General Public License as published by the Free Software Foundation, either
+ * version 3 of the License, or (at your option) any later version.
+ *
+ * ndncert is distributed in the hope that it will be useful, but WITHOUT ANY
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+ * PARTICULAR PURPOSE.  See the GNU General Public License for more details.
+ *
+ * You should have received copies of the GNU General Public License along with
+ * ndncert, e.g., in COPYING.md file.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ * See AUTHORS.md for complete list of ndncert authors and contributors.
+ */
+
+#include "ndncert-common.hpp"
+
+namespace ndn {
+namespace ndncert {
+
+std::string statusToString(Status status) {
+  switch (status)
+  {
+  case Status::BEFORE_CHALLENGE:
+    return "Before challenge";
+  case Status::CHALLENGE:
+    return "In challenge";
+  case Status::PENDING:
+    return "Pending after challenge";
+  case Status::SUCCESS:
+    return "Success";
+  case Status::FAILURE:
+    return "Failure";
+  case Status::NOT_STARTED:
+    return "Not started";
+  case Status::ENDED:
+    return "Ended";
+  default:
+    return "Unrecognized status";
+  }
+}
+
+}  // namespace ndncert
+}  // namespace ndn
diff --git a/src/ndncert-common.hpp b/src/ndncert-common.hpp
index 4109d58..cbbba39 100644
--- a/src/ndncert-common.hpp
+++ b/src/ndncert-common.hpp
@@ -35,44 +35,42 @@
 #define PROTECTED_WITH_TESTS_ELSE_PRIVATE private
 #endif
 
-#include <cstddef>
-#include <cstdint>
-
-#include <ndn-cxx/interest.hpp>
-#include <ndn-cxx/data.hpp>
-#include <ndn-cxx/name.hpp>
-#include <ndn-cxx/face.hpp>
-#include <ndn-cxx/link.hpp>
-#include <ndn-cxx/encoding/block.hpp>
-#include <ndn-cxx/lp/nack.hpp>
-#include <ndn-cxx/security/key-chain.hpp>
-#include <ndn-cxx/security/v2/certificate.hpp>
-
 #include <boost/algorithm/string.hpp>
 #include <boost/assert.hpp>
 #include <boost/noncopyable.hpp>
 #include <boost/throw_exception.hpp>
+#include <cstddef>
+#include <cstdint>
+#include <ndn-cxx/data.hpp>
+#include <ndn-cxx/encoding/block.hpp>
+#include <ndn-cxx/face.hpp>
+#include <ndn-cxx/interest.hpp>
+#include <ndn-cxx/link.hpp>
+#include <ndn-cxx/lp/nack.hpp>
+#include <ndn-cxx/name.hpp>
+#include <ndn-cxx/security/key-chain.hpp>
+#include <ndn-cxx/security/v2/certificate.hpp>
 
 namespace ndn {
 namespace ndncert {
 
-using std::size_t;
 using boost::noncopyable;
-using std::shared_ptr;
-using std::unique_ptr;
-using std::weak_ptr;
-using std::make_shared;
-using ndn::make_unique;
-using std::enable_shared_from_this;
-using std::function;
-using std::bind;
-using ndn::Interest;
+using ndn::Block;
 using ndn::Data;
+using ndn::Interest;
+using ndn::make_unique;
 using ndn::Name;
 using ndn::PartialName;
-using ndn::Block;
 using ndn::time::system_clock;
 using ndn::time::toUnixTimestamp;
+using std::bind;
+using std::enable_shared_from_this;
+using std::function;
+using std::make_shared;
+using std::shared_ptr;
+using std::size_t;
+using std::unique_ptr;
+using std::weak_ptr;
 
 enum : uint32_t {
   tlv_ca_prefix = 129,
@@ -81,6 +79,7 @@
   tlv_parameter_value = 135,
   tlv_ca_certificate = 137,
   tlv_max_validity_period = 139,
+  tlv_max_suffix_length = 177,
   tlv_probe_response = 141,
   tlv_allow_longer_name = 143,
   tlv_ecdh_pub = 145,
@@ -99,7 +98,6 @@
   tlv_error_code = 171,
   tlv_error_info = 173,
   tlv_authentication_tag = 175,
-  tlv_max_suffix_length = 177,
   tlv_cert_to_revoke = 179
 };
 
@@ -111,8 +109,9 @@
 const std::string CONFIG_PROBE_PARAMETER = "probe-parameter-key";
 const std::string CONFIG_SUPPORTED_CHALLENGES = "supported-challenges";
 const std::string CONFIG_CHALLENGE = "challenge";
+const std::string CONFIG_MAX_SUFFIX_LENGTH = "max-suffix-length";
 
-// JSON format for Certificate Issuer (CA)
+// // JSON format for Certificate Issuer (CA)
 const std::string JSON_CA_NAME = "name";
 const std::string JSON_CA_CONFIG = "ca-config";
 const std::string JSON_CA_ECDH = "ecdh-pub";
@@ -123,13 +122,13 @@
 const std::string JSON_CA_CHALLENGE_ID = "challenge-id";
 const std::string JSON_CA_CERT_ID = "certificate-id";
 
-// JSON format for Challenge Module
+// // JSON format for Challenge Module
 const std::string JSON_CHALLENGE_STATUS = "challenge-status";
 const std::string JSON_CHALLENGE_REMAINING_TRIES = "remaining-tries";
 const std::string JSON_CHALLENGE_REMAINING_TIME = "remaining-time";
 const std::string JSON_CHALLENGE_ISSUED_CERT_NAME = "issued-cert-name";
 
-// JSON format for Certificate Requester
+// // JSON format for Certificate Requester
 const std::string JSON_CLIENT_PROBE_INFO = "probe-info";
 const std::string JSON_CLIENT_ECDH = "ecdh-pub";
 const std::string JSON_CLIENT_CERT_REQ = "cert-request";
@@ -137,14 +136,28 @@
 const std::string JSON_CLIENT_CERT_TO_REVOKE = "cert-to-revoke";
 
 // NDNCERT Status Enum
-enum {
-  STATUS_BEFORE_CHALLENGE = 0,
-  STATUS_CHALLENGE = 1,
-  STATUS_PENDING = 2,
-  STATUS_SUCCESS = 3,
-  STATUS_FAILURE = 4,
-  STATUS_NOT_STARTED = 5,
-  STATUS_ENDED = 6
+enum class Status : uint16_t {
+  BEFORE_CHALLENGE = 0,
+  CHALLENGE = 1,
+  PENDING = 2,
+  SUCCESS = 3,
+  FAILURE = 4,
+  NOT_STARTED = 5,
+  ENDED = 6
+};
+
+std::string statusToString(Status status);
+
+enum class Error : uint16_t {
+  BAD_INTEREST_FORMAT = 1,
+  BAD_PARAMETER_FORMAT = 2,
+  BAD_SIGNATURE = 3,
+  INVALID_PARAMETER = 4,
+  NAME_NOT_ALLOWED = 5,
+  BAD_VALIDITY_PERIOD = 6,
+  OUT_OF_TRIES = 7,
+  OUT_OF_TIME = 8,
+  NO_AVAILABLE_NAMES = 9
 };
 
 // Pre-defined challenge status
@@ -153,7 +166,7 @@
 const std::string CHALLENGE_STATUS_FAILURE_MAXRETRY = "failure-max-retry";
 const std::string CHALLENGE_STATUS_UNKNOWN_CHALLENGE = "unknown-challenge";
 
-} // namespace ndncert
-} // namespace ndn
+}  // namespace ndncert
+}  // namespace ndn
 
-#endif // NDNCERT_NDNCERT_COMMON_HPP
+#endif  // NDNCERT_NDNCERT_COMMON_HPP
diff --git a/src/protocol-detail/challenge.cpp b/src/protocol-detail/challenge.cpp
index 2923270..e4d5ecb 100644
--- a/src/protocol-detail/challenge.cpp
+++ b/src/protocol-detail/challenge.cpp
@@ -29,7 +29,7 @@
 CHALLENGE::encodeDataPayload(const CertificateRequest& request)
 {
   Block response = makeEmptyBlock(tlv_encrypted_payload);
-  response.push_back(makeNonNegativeIntegerBlock(tlv_status, request.m_status));
+  response.push_back(makeNonNegativeIntegerBlock(tlv_status, static_cast<size_t>(request.m_status)));
   response.push_back(makeStringBlock(tlv_challenge_status, request.m_challengeStatus));
   response.push_back(makeNonNegativeIntegerBlock(tlv_remaining_tries, request.m_remainingTries));
   response.push_back(makeNonNegativeIntegerBlock(tlv_remaining_time, request.m_remainingTime));
diff --git a/src/protocol-detail/new.cpp b/src/protocol-detail/new.cpp
index 20eaafb..0c33ba8 100644
--- a/src/protocol-detail/new.cpp
+++ b/src/protocol-detail/new.cpp
@@ -63,7 +63,7 @@
   response.push_back(makeStringBlock(tlv_ecdh_pub, ecdhKey));
   response.push_back(makeStringBlock(tlv_salt, salt));
   response.push_back(makeStringBlock(tlv_request_id, request.m_requestId));
-  response.push_back(makeNonNegativeIntegerBlock(tlv_status, request.m_status));
+  response.push_back(makeNonNegativeIntegerBlock(tlv_status, static_cast<size_t>(request.m_status)));
   for (const auto& entry: challenges) {
     response.push_back(makeStringBlock(tlv_challenge, entry));
   }
diff --git a/src/protocol-detail/revoke.cpp b/src/protocol-detail/revoke.cpp
index 5bde720..b31ae55 100644
--- a/src/protocol-detail/revoke.cpp
+++ b/src/protocol-detail/revoke.cpp
@@ -62,7 +62,7 @@
   response.push_back(makeStringBlock(tlv_ecdh_pub, ecdhKey));
   response.push_back(makeStringBlock(tlv_salt, salt));
   response.push_back(makeStringBlock(tlv_request_id, request.m_requestId));
-  response.push_back(makeNonNegativeIntegerBlock(tlv_status, request.m_status));
+  response.push_back(makeNonNegativeIntegerBlock(tlv_status, static_cast<size_t>(request.m_status)));
   for (const auto& entry: challenges) {
     response.push_back(makeStringBlock(tlv_challenge, entry));
   }
diff --git a/tests/unit-tests/bench.t.cpp b/tests/unit-tests/bench.t.cpp
index 3f015b8..a8602ef 100644
--- a/tests/unit-tests/bench.t.cpp
+++ b/tests/unit-tests/bench.t.cpp
@@ -120,7 +120,7 @@
       BOOST_CHECK(security::verifySignature(response, cert));
 
       client.onChallengeResponse(response);
-      BOOST_CHECK_EQUAL(client.m_status, STATUS_CHALLENGE);
+      BOOST_CHECK(client.m_status == Status::CHALLENGE);
       BOOST_CHECK_EQUAL(client.m_challengeStatus, ChallengePin::NEED_CODE);
 
       auto paramJson = pinChallenge.getRequirementForChallenge(client.m_status, client.m_challengeStatus);
@@ -133,7 +133,7 @@
       BOOST_CHECK(security::verifySignature(response, cert));
 
       client.onChallengeResponse(response);
-      BOOST_CHECK_EQUAL(client.m_status, STATUS_CHALLENGE);
+      BOOST_CHECK(client.m_status == Status::CHALLENGE);
       BOOST_CHECK_EQUAL(client.m_challengeStatus, ChallengePin::WRONG_CODE);
 
       auto paramJson = pinChallenge.getRequirementForChallenge(client.m_status, client.m_challengeStatus);
@@ -154,7 +154,7 @@
       BOOST_CHECK(security::verifySignature(response, cert));
 
       client.onChallengeResponse(response);
-      BOOST_CHECK_EQUAL(client.m_status, STATUS_SUCCESS);
+      BOOST_CHECK(client.m_status == Status::SUCCESS);
       BOOST_CHECK_EQUAL(client.m_challengeStatus, CHALLENGE_STATUS_SUCCESS);
     }
   });
diff --git a/tests/unit-tests/ca-memory.t.cpp b/tests/unit-tests/ca-memory.t.cpp
index a1bcd28..01812af 100644
--- a/tests/unit-tests/ca-memory.t.cpp
+++ b/tests/unit-tests/ca-memory.t.cpp
@@ -82,31 +82,31 @@
   auto cert1 = key1.getDefaultCertificate();
 
   // add operation
-  CertificateRequest request1(Name("/ndn/site1"), "123", REQUEST_TYPE_NEW, STATUS_BEFORE_CHALLENGE, cert1);
+  CertificateRequest request1(Name("/ndn/site1"), "123", REQUEST_TYPE_NEW, Status::BEFORE_CHALLENGE, cert1);
   BOOST_CHECK_NO_THROW(storage.addRequest(request1));
 
   // get operation
   auto result = storage.getRequest("123");
   BOOST_CHECK_EQUAL(request1.m_cert, result.m_cert);
-  BOOST_CHECK_EQUAL(request1.m_status, result.m_status);
+  BOOST_CHECK(request1.m_status == result.m_status);
   BOOST_CHECK_EQUAL(request1.m_caPrefix, result.m_caPrefix);
 
   JsonSection json;
   json.put("code", "1234");
 
   // update operation
-  CertificateRequest request2(Name("/ndn/site1"), "123", REQUEST_TYPE_NEW, STATUS_CHALLENGE, CHALLENGE_STATUS_SUCCESS,
-                             "Email", time::toIsoString(time::system_clock::now()), 3600, 3, json, cert1);
+  CertificateRequest request2(Name("/ndn/site1"), "123", REQUEST_TYPE_NEW, Status::CHALLENGE, CHALLENGE_STATUS_SUCCESS,
+                              "Email", time::toIsoString(time::system_clock::now()), 3600, 3, json, cert1);
   storage.updateRequest(request2);
   result = storage.getRequest("123");
   BOOST_CHECK_EQUAL(request2.m_cert, result.m_cert);
-  BOOST_CHECK_EQUAL(request2.m_status, result.m_status);
+  BOOST_CHECK(request2.m_status == result.m_status);
   BOOST_CHECK_EQUAL(request2.m_caPrefix, result.m_caPrefix);
 
   auto identity2 = addIdentity(Name("/ndn/site2"));
   auto key2 = identity2.getDefaultKey();
   auto cert2 = key2.getDefaultCertificate();
-  CertificateRequest request3(Name("/ndn/site2"), "456", REQUEST_TYPE_NEW, STATUS_BEFORE_CHALLENGE, cert2);
+  CertificateRequest request3(Name("/ndn/site2"), "456", REQUEST_TYPE_NEW, Status::BEFORE_CHALLENGE, cert2);
   storage.addRequest(request3);
 
   // list operation
@@ -118,8 +118,8 @@
   BOOST_CHECK_EQUAL(allRequests.size(), 1);
 }
 
-BOOST_AUTO_TEST_SUITE_END() // TestCaModule
+BOOST_AUTO_TEST_SUITE_END()  // TestCaModule
 
-} // namespace tests
-} // namespace ndncert
-} // namespace ndn
+}  // namespace tests
+}  // namespace ndncert
+}  // namespace ndn
diff --git a/tests/unit-tests/ca-module.t.cpp b/tests/unit-tests/ca-module.t.cpp
index 0bd93bf..9e0289a 100644
--- a/tests/unit-tests/ca-module.t.cpp
+++ b/tests/unit-tests/ca-module.t.cpp
@@ -315,7 +315,7 @@
       BOOST_CHECK(security::verifySignature(response, cert));
 
       client.onChallengeResponse(response);
-      BOOST_CHECK_EQUAL(client.m_status, STATUS_CHALLENGE);
+      BOOST_CHECK(client.m_status == Status::CHALLENGE);
       BOOST_CHECK_EQUAL(client.m_challengeStatus, ChallengePin::NEED_CODE);
 
       auto paramJson = pinChallenge.getRequirementForChallenge(client.m_status, client.m_challengeStatus);
@@ -328,7 +328,7 @@
       BOOST_CHECK(security::verifySignature(response, cert));
 
       client.onChallengeResponse(response);
-      BOOST_CHECK_EQUAL(client.m_status, STATUS_CHALLENGE);
+      BOOST_CHECK(client.m_status == Status::CHALLENGE);
       BOOST_CHECK_EQUAL(client.m_challengeStatus, ChallengePin::WRONG_CODE);
 
       auto paramJson = pinChallenge.getRequirementForChallenge(client.m_status, client.m_challengeStatus);
@@ -347,7 +347,7 @@
       BOOST_CHECK(security::verifySignature(response, cert));
 
       client.onChallengeResponse(response);
-      BOOST_CHECK_EQUAL(client.m_status, STATUS_SUCCESS);
+      BOOST_CHECK(client.m_status == Status::SUCCESS);
       BOOST_CHECK_EQUAL(client.m_challengeStatus, CHALLENGE_STATUS_SUCCESS);
     }
   });
@@ -385,7 +385,7 @@
   signatureInfo.setValidityPeriod(security::ValidityPeriod(time::system_clock::now(),
           time::system_clock::now() + time::hours(10)));
   m_keyChain.sign(clientCert, signingByKey(clientKey.getName()).setSignatureInfo(signatureInfo));
-  CertificateRequest certRequest(Name("/ndn"), "122", REQUEST_TYPE_NEW, STATUS_SUCCESS, clientCert);
+  CertificateRequest certRequest(Name("/ndn"), "122", REQUEST_TYPE_NEW, Status::SUCCESS, clientCert);
   auto issuedCert = ca.issueCertificate(certRequest);
 
   ClientModule client(m_keyChain);
diff --git a/tests/unit-tests/ca-sqlite.t.cpp b/tests/unit-tests/ca-sqlite.t.cpp
index aa70f3a..467ddb3 100644
--- a/tests/unit-tests/ca-sqlite.t.cpp
+++ b/tests/unit-tests/ca-sqlite.t.cpp
@@ -81,30 +81,30 @@
   auto cert1 = key1.getDefaultCertificate();
 
   // add operation
-  CertificateRequest request1(Name("/ndn/site1"), "123", REQUEST_TYPE_NEW, STATUS_BEFORE_CHALLENGE, cert1);
+  CertificateRequest request1(Name("/ndn/site1"), "123", REQUEST_TYPE_NEW, Status::BEFORE_CHALLENGE, cert1);
   BOOST_CHECK_NO_THROW(storage.addRequest(request1));
 
   // get operation
   auto result = storage.getRequest("123");
   BOOST_CHECK_EQUAL(request1.m_cert, result.m_cert);
-  BOOST_CHECK_EQUAL(request1.m_status, result.m_status);
+  BOOST_CHECK(request1.m_status == result.m_status);
   BOOST_CHECK_EQUAL(request1.m_caPrefix, result.m_caPrefix);
 
   // update operation
   JsonSection json;
   json.put("test", "4567");
-  CertificateRequest request2(Name("/ndn/site1"), "123", REQUEST_TYPE_NEW, STATUS_CHALLENGE, CHALLENGE_STATUS_SUCCESS,
+  CertificateRequest request2(Name("/ndn/site1"), "123", REQUEST_TYPE_NEW, Status::CHALLENGE, CHALLENGE_STATUS_SUCCESS,
                              "Email", time::toIsoString(time::system_clock::now()), 3600, 3, json, cert1);
   storage.updateRequest(request2);
   result = storage.getRequest("123");
   BOOST_CHECK_EQUAL(request2.m_cert, result.m_cert);
-  BOOST_CHECK_EQUAL(request2.m_status, result.m_status);
+  BOOST_CHECK(request2.m_status == result.m_status);
   BOOST_CHECK_EQUAL(request2.m_caPrefix, result.m_caPrefix);
 
   auto identity2 = addIdentity(Name("/ndn/site2"));
   auto key2 = identity2.getDefaultKey();
   auto cert2 = key2.getDefaultCertificate();
-  CertificateRequest request3(Name("/ndn/site2"), "456", REQUEST_TYPE_NEW, STATUS_BEFORE_CHALLENGE, cert2);
+  CertificateRequest request3(Name("/ndn/site2"), "456", REQUEST_TYPE_NEW, Status::BEFORE_CHALLENGE, cert2);
   storage.addRequest(request3);
 
   // list operation
diff --git a/tests/unit-tests/challenge-credential.t.cpp b/tests/unit-tests/challenge-credential.t.cpp
index 7b101d7..e600e20 100644
--- a/tests/unit-tests/challenge-credential.t.cpp
+++ b/tests/unit-tests/challenge-credential.t.cpp
@@ -55,7 +55,7 @@
   auto identityA = addIdentity(Name("/example"));
   auto keyA = identityA.getDefaultKey();
   auto certA = key.getDefaultCertificate();
-  CertificateRequest request(Name("/example"), "123", REQUEST_TYPE_NEW, STATUS_BEFORE_CHALLENGE, certA);
+  CertificateRequest request(Name("/example"), "123", REQUEST_TYPE_NEW, Status::BEFORE_CHALLENGE, certA);
 
   // create requester's existing cert
   auto identityB = addIdentity(Name("/trust/cert"));
@@ -96,7 +96,7 @@
   params.encode();
 
   challenge.handleChallengeRequest(params, request);
-  BOOST_CHECK_EQUAL(request.m_status, STATUS_PENDING);
+  BOOST_CHECK(request.m_status == Status::PENDING);
   BOOST_CHECK_EQUAL(request.m_challengeStatus, CHALLENGE_STATUS_SUCCESS);
 }
 
diff --git a/tests/unit-tests/challenge-email.t.cpp b/tests/unit-tests/challenge-email.t.cpp
index 50e30c5..4beb6b4 100644
--- a/tests/unit-tests/challenge-email.t.cpp
+++ b/tests/unit-tests/challenge-email.t.cpp
@@ -45,7 +45,7 @@
   auto identity = addIdentity(Name("/ndn/site1"));
   auto key = identity.getDefaultKey();
   auto cert = key.getDefaultCertificate();
-  CertificateRequest request(Name("/ndn/site1"), "123", REQUEST_TYPE_NEW, STATUS_BEFORE_CHALLENGE, cert);
+  CertificateRequest request(Name("/ndn/site1"), "123", REQUEST_TYPE_NEW, Status::BEFORE_CHALLENGE, cert);
 
   Block paramTLV = makeEmptyBlock(tlv_encrypted_payload);
   paramTLV.push_back(makeStringBlock(tlv_parameter_key, ChallengeEmail::JSON_EMAIL));
@@ -54,7 +54,7 @@
   ChallengeEmail challenge("./tests/unit-tests/test-send-email.sh");
   challenge.handleChallengeRequest(paramTLV, request);
 
-  BOOST_CHECK_EQUAL(request.m_status, STATUS_CHALLENGE);
+  BOOST_CHECK(request.m_status == Status::CHALLENGE);
   BOOST_CHECK_EQUAL(request.m_challengeStatus, ChallengeEmail::NEED_CODE);
   BOOST_CHECK(request.m_challengeSecrets.get<std::string>(ChallengeEmail::JSON_CODE) != "");
   BOOST_CHECK(request.m_remainingTime != 0);
@@ -95,7 +95,7 @@
   auto identity = addIdentity(Name("/ndn/site1"));
   auto key = identity.getDefaultKey();
   auto cert = key.getDefaultCertificate();
-  CertificateRequest request(Name("/ndn/site1"), "123", REQUEST_TYPE_NEW, STATUS_BEFORE_CHALLENGE, cert);
+  CertificateRequest request(Name("/ndn/site1"), "123", REQUEST_TYPE_NEW, Status::BEFORE_CHALLENGE, cert);
 
   Block paramTLV = makeEmptyBlock(tlv_encrypted_payload);
   paramTLV.push_back(makeStringBlock(tlv_parameter_key, ChallengeEmail::JSON_EMAIL));
@@ -105,7 +105,7 @@
   challenge.handleChallengeRequest(paramTLV, request);
 
   BOOST_CHECK_EQUAL(request.m_challengeStatus, ChallengeEmail::FAILURE_INVALID_EMAIL);
-  BOOST_CHECK_EQUAL(request.m_status, STATUS_FAILURE);
+  BOOST_CHECK(request.m_status == Status::FAILURE);
 }
 
 BOOST_AUTO_TEST_CASE(OnChallengeRequestWithCode)
@@ -115,7 +115,7 @@
   auto cert = key.getDefaultCertificate();
   JsonSection json;
   json.put(ChallengeEmail::JSON_CODE, "4567");
-  CertificateRequest request(Name("/ndn/site1"), "123", REQUEST_TYPE_NEW, STATUS_CHALLENGE, ChallengeEmail::NEED_CODE,
+  CertificateRequest request(Name("/ndn/site1"), "123", REQUEST_TYPE_NEW, Status::CHALLENGE, ChallengeEmail::NEED_CODE,
                              "Email", time::toIsoString(time::system_clock::now()), 3600, 3, json, cert);
 
   Block paramTLV = makeEmptyBlock(tlv_encrypted_payload);
@@ -126,7 +126,7 @@
   challenge.handleChallengeRequest(paramTLV, request);
 
   BOOST_CHECK_EQUAL(request.m_challengeStatus, CHALLENGE_STATUS_SUCCESS);
-  BOOST_CHECK_EQUAL(request.m_status, STATUS_PENDING);
+  BOOST_CHECK(request.m_status == Status::PENDING);
   BOOST_CHECK_EQUAL(request.m_challengeSecrets.empty(), true);
 }
 
@@ -137,7 +137,7 @@
   auto cert = key.getDefaultCertificate();
   JsonSection json;
   json.put(ChallengeEmail::JSON_CODE, "4567");
-  CertificateRequest request(Name("/ndn/site1"), "123", REQUEST_TYPE_NEW, STATUS_CHALLENGE, ChallengeEmail::NEED_CODE,
+  CertificateRequest request(Name("/ndn/site1"), "123", REQUEST_TYPE_NEW, Status::CHALLENGE, ChallengeEmail::NEED_CODE,
                              "email", time::toIsoString(time::system_clock::now()), 3600, 3, json, cert);
 
   Block paramTLV = makeEmptyBlock(tlv_encrypted_payload);
@@ -148,7 +148,7 @@
   challenge.handleChallengeRequest(paramTLV, request);
 
   BOOST_CHECK_EQUAL(request.m_challengeStatus, ChallengeEmail::WRONG_CODE);
-  BOOST_CHECK_EQUAL(request.m_status, STATUS_CHALLENGE);
+  BOOST_CHECK(request.m_status == Status::CHALLENGE);
   BOOST_CHECK_EQUAL(request.m_challengeSecrets.empty(), false);
 }
 
diff --git a/tests/unit-tests/challenge-pin.t.cpp b/tests/unit-tests/challenge-pin.t.cpp
index 9cabf38..ef0a572 100644
--- a/tests/unit-tests/challenge-pin.t.cpp
+++ b/tests/unit-tests/challenge-pin.t.cpp
@@ -38,12 +38,12 @@
   auto identity = addIdentity(Name("/ndn/site1"));
   auto key = identity.getDefaultKey();
   auto cert = key.getDefaultCertificate();
-  CertificateRequest request(Name("/ndn/site1"), "123", REQUEST_TYPE_NEW, STATUS_BEFORE_CHALLENGE, cert);
+  CertificateRequest request(Name("/ndn/site1"), "123", REQUEST_TYPE_NEW, Status::BEFORE_CHALLENGE, cert);
 
   ChallengePin challenge;
   challenge.handleChallengeRequest(makeEmptyBlock(tlv_encrypted_payload), request);
 
-  BOOST_CHECK_EQUAL(request.m_status, STATUS_CHALLENGE);
+  BOOST_CHECK(request.m_status == Status::CHALLENGE);
   BOOST_CHECK_EQUAL(request.m_challengeStatus, ChallengePin::NEED_CODE);
   BOOST_CHECK_EQUAL(request.m_challengeType, "pin");
 }
@@ -55,7 +55,7 @@
   auto cert = key.getDefaultCertificate();
   JsonSection secret;
   secret.add(ChallengePin::JSON_PIN_CODE, "12345");
-  CertificateRequest request(Name("/ndn/site1"), "123", REQUEST_TYPE_NEW, STATUS_CHALLENGE, ChallengePin::NEED_CODE, "pin",
+  CertificateRequest request(Name("/ndn/site1"), "123", REQUEST_TYPE_NEW, Status::CHALLENGE, ChallengePin::NEED_CODE, "pin",
                              time::toIsoString(time::system_clock::now()), 3600, 3, secret, cert);
 
   Block paramTLV = makeEmptyBlock(tlv_encrypted_payload);
@@ -65,7 +65,7 @@
   ChallengePin challenge;
   challenge.handleChallengeRequest(paramTLV, request);
 
-  BOOST_CHECK_EQUAL(request.m_status, STATUS_PENDING);
+  BOOST_CHECK(request.m_status == Status::PENDING);
   BOOST_CHECK_EQUAL(request.m_challengeStatus, CHALLENGE_STATUS_SUCCESS);
   BOOST_CHECK_EQUAL(request.m_challengeSecrets.empty(), true);
 }
@@ -77,7 +77,7 @@
   auto cert = key.getDefaultCertificate();
   JsonSection secret;
   secret.add(ChallengePin::JSON_PIN_CODE, "12345");
-  CertificateRequest request(Name("/ndn/site1"), "123", REQUEST_TYPE_NEW, STATUS_CHALLENGE, ChallengePin::NEED_CODE, "pin",
+  CertificateRequest request(Name("/ndn/site1"), "123", REQUEST_TYPE_NEW, Status::CHALLENGE, ChallengePin::NEED_CODE, "pin",
                              time::toIsoString(time::system_clock::now()), 3600, 3, secret, cert);
 
   Block paramTLV = makeEmptyBlock(tlv_encrypted_payload);
@@ -87,7 +87,7 @@
   ChallengePin challenge;
   challenge.handleChallengeRequest(paramTLV, request);
 
-  BOOST_CHECK_EQUAL(request.m_status, STATUS_CHALLENGE);
+  BOOST_CHECK(request.m_status == Status::CHALLENGE);
   BOOST_CHECK_EQUAL(request.m_challengeStatus, ChallengePin::WRONG_CODE);
   BOOST_CHECK_EQUAL(request.m_challengeSecrets.empty(), false);
 }
diff --git a/tests/unit-tests/challenge-private-key.t.cpp b/tests/unit-tests/challenge-private-key.t.cpp
index 6c26d41..20eceaa 100644
--- a/tests/unit-tests/challenge-private-key.t.cpp
+++ b/tests/unit-tests/challenge-private-key.t.cpp
@@ -38,7 +38,7 @@
   auto identityA = addIdentity(Name("/example"));
   auto keyA = identityA.getDefaultKey();
   auto certA = keyA.getDefaultCertificate();
-  CertificateRequest request(Name("/example"), "123", REQUEST_TYPE_REVOKE, STATUS_BEFORE_CHALLENGE, certA);
+  CertificateRequest request(Name("/example"), "123", REQUEST_TYPE_REVOKE, Status::BEFORE_CHALLENGE, certA);
 
   security::v2::Certificate privateKeyProof;
   privateKeyProof.setName(Name(keyA.getName()).append("proof-of-private-key").appendVersion());
@@ -64,7 +64,7 @@
   params.encode();
 
   challenge.handleChallengeRequest(params, request);
-  BOOST_CHECK_EQUAL(request.m_status, STATUS_PENDING);
+  BOOST_CHECK(request.m_status == Status::PENDING);
   BOOST_CHECK_EQUAL(request.m_challengeStatus, CHALLENGE_STATUS_SUCCESS);
 }
 
diff --git a/tools/ndncert-ca-server.cpp b/tools/ndncert-ca-server.cpp
index 10d6a6f..82f7c70 100644
--- a/tools/ndncert-ca-server.cpp
+++ b/tools/ndncert-ca-server.cpp
@@ -83,7 +83,7 @@
 
   if (wantRepoOut) {
       ca.setStatusUpdateCallback([&] (const CertificateRequest& request) {
-          if (request.m_status == STATUS_SUCCESS && request.m_requestType == REQUEST_TYPE_NEW) {
+          if (request.m_status == Status::SUCCESS && request.m_requestType == REQUEST_TYPE_NEW) {
             auto issuedCert = request.m_cert;
             boost::asio::ip::tcp::iostream requestStream;
 #if BOOST_VERSION >= 106700
diff --git a/tools/ndncert-ca-status.cpp b/tools/ndncert-ca-status.cpp
index ecfc9c6..cf1c862 100644
--- a/tools/ndncert-ca-status.cpp
+++ b/tools/ndncert-ca-status.cpp
@@ -77,7 +77,7 @@
   for (const auto& entry : requestList) {
     std::cerr << "Request ID: " << entry.m_requestId << "\t"
               << "Request Type" << entry.m_requestType << "\t"
-              << "Current Status: " << entry.m_status << std::endl
+              << "Current Status: " << statusToString(entry.m_status) << std::endl
               << "Applying CA: " << entry.m_caPrefix << std::endl
               << "Applying for key: " << entry.m_cert.getName() << std::endl
               << "Challenge remaining tries: " << entry.m_remainingTries << std::endl
diff --git a/tools/ndncert-client.cpp b/tools/ndncert-client.cpp
index 0073521..52d0fdb 100644
--- a/tools/ndncert-client.cpp
+++ b/tools/ndncert-client.cpp
@@ -18,23 +18,23 @@
  * See AUTHORS.md for complete list of ndncert authors and contributors.
  */
 
-#include "challenge-module.hpp"
-#include "protocol-detail/info.hpp"
-#include "client-module.hpp"
-#include <iostream>
-#include <string>
-
 #include <boost/asio.hpp>
 #include <boost/program_options/options_description.hpp>
 #include <boost/program_options/parsers.hpp>
 #include <boost/program_options/variables_map.hpp>
-
+#include <iostream>
 #include <ndn-cxx/security/verification-helpers.hpp>
+#include <string>
+
+#include "challenge-module.hpp"
+#include "client-module.hpp"
+#include "protocol-detail/info.hpp"
 
 namespace ndn {
 namespace ndncert {
 
-static void startApplication();
+static void
+startApplication();
 
 int nStep;
 Face face;
@@ -127,7 +127,7 @@
 challengeCb(const Data& reply)
 {
   client.onChallengeResponse(reply);
-  if (client.getApplicationStatus() == STATUS_SUCCESS) {
+  if (client.getApplicationStatus() == Status::SUCCESS) {
     std::cerr << "DONE! Certificate has already been issued \n";
     face.expressInterest(*client.generateCertFetchInterest(), bind(&certFetchCb, _2),
                          bind(&onNackCb), bind(&timeoutCb));
@@ -149,8 +149,8 @@
     }
   }
   face.expressInterest(*client.generateChallengeInterest(challenge->genChallengeRequestTLV(client.getApplicationStatus(),
-                                                                                            client.getChallengeStatus(),
-                                                                                            requirement)),
+                                                                                           client.getChallengeStatus(),
+                                                                                           requirement)),
                        bind(&challengeCb, _2), bind(&onNackCb), bind(&timeoutCb));
 }
 
@@ -169,7 +169,7 @@
     std::cerr << "Step " << nStep++ << ": Please type in the challenge index that you want to perform\n";
     count = 0;
     for (auto item : challengeList) {
-      std::cerr << "\t" << count++ << " : "<< item << std::endl;
+      std::cerr << "\t" << count++ << " : " << item << std::endl;
     }
     getline(std::cin, choice);
     try {
@@ -208,8 +208,8 @@
     }
   }
   face.expressInterest(*client.generateChallengeInterest(challenge->genChallengeRequestTLV(client.getApplicationStatus(),
-                                                                                            client.getChallengeStatus(),
-                                                                                            requirement)),
+                                                                                           client.getChallengeStatus(),
+                                                                                           requirement)),
                        bind(&challengeCb, _2), bind(&onNackCb), bind(&timeoutCb));
 }
 
@@ -378,11 +378,8 @@
   namespace po = boost::program_options;
   std::string configFilePath = std::string(SYSCONFDIR) + "/ndncert/client.conf";
   po::options_description description("General Usage\n ndncert-client [-h] [-c] [-v]\n");
-  description.add_options()
-    ("help,h", "produce help message")
-    ("config-file,c",     po::value<std::string>(&configFilePath), "configuration file name")
-    ("validity-period,v", po::value<int>(&validityPeriod)->default_value(-1),
-                          "desired validity period (hours) of the certificate being requested");
+  description.add_options()("help,h", "produce help message")("config-file,c", po::value<std::string>(&configFilePath), "configuration file name")("validity-period,v", po::value<int>(&validityPeriod)->default_value(-1),
+                                                                                                                                                   "desired validity period (hours) of the certificate being requested");
   po::positional_options_description p;
 
   po::variables_map vm;
@@ -410,10 +407,11 @@
   return 0;
 }
 
-} // namespace ndncert
-} // namespace ndn
+}  // namespace ndncert
+}  // namespace ndn
 
-int main(int argc, char* argv[])
+int
+main(int argc, char* argv[])
 {
   return ndn::ndncert::main(argc, argv);
 }
