diff --git a/src/ca-module.cpp b/src/ca-module.cpp
index 73582a8..8b9ba5c 100644
--- a/src/ca-module.cpp
+++ b/src/ca-module.cpp
@@ -38,8 +38,8 @@
 namespace ndncert {
 namespace ca {
 
-static const time::seconds DEFAULT_DATA_FRESHNESS_PERIOD = 1_s;
-static const time::seconds REQUEST_VALIDITY_PERIOD_NOT_BEFORE_GRACE_PERIOD = 120_s;
+const time::seconds DEFAULT_DATA_FRESHNESS_PERIOD = 1_s;
+const time::seconds REQUEST_VALIDITY_PERIOD_NOT_BEFORE_GRACE_PERIOD = 120_s;
 
 NDN_LOG_INIT(ndncert.ca);
 
@@ -51,10 +51,13 @@
   // load the config and create storage
   m_config.load(configPath);
   m_storage = CaStorage::createCaStorage(storageType, m_config.caProfile.caPrefix, "");
-  ndn::random::generateSecureBytes(m_requestIdGenKey, 32);
-  if (m_config.nameAssignmentFuncs.size() == 0) {
+
+  ndn::random::generateSecureBytes(m_requestIdGenKey);
+
+  if (m_config.nameAssignmentFuncs.empty()) {
     m_config.nameAssignmentFuncs.push_back(NameAssignmentFunc::createNameAssignmentFunc("random"));
   }
+
   registerPrefix();
 }
 
@@ -75,11 +78,10 @@
   Name prefix = m_config.caProfile.caPrefix;
   prefix.append("CA");
 
-  auto prefixId = m_face.registerPrefix(
-    prefix,
+  auto prefixId = m_face.registerPrefix(prefix,
     [&] (const Name& name) {
       // register INFO RDR metadata prefix
-      ndn::name::Component metaDataComp(32, reinterpret_cast<const uint8_t*>("metadata"), std::strlen("metadata"));
+      const auto& metaDataComp = ndn::MetadataObject::getKeywordComponent();
       auto filterId = m_face.setInterestFilter(Name(name).append("INFO").append(metaDataComp),
                                                [this] (auto&&, const auto& i) { onCaProfileDiscovery(i); });
       m_interestFilterHandles.push_back(filterId);
@@ -147,8 +149,7 @@
   ndn::MetadataObject metadata;
   metadata.setVersionedName(m_profileData->getName().getPrefix(-1));
   Name discoveryInterestName(m_profileData->getName().getPrefix(-2));
-  ndn::name::Component metadataComponent(32, reinterpret_cast<const uint8_t*>("metadata"), std::strlen("metadata"));
-  discoveryInterestName.append(metadataComponent);
+  discoveryInterestName.append(ndn::MetadataObject::getKeywordComponent());
   m_face.put(metadata.makeData(discoveryInterestName, m_keyChain, signingByIdentity(m_config.caProfile.caPrefix)));
 }
 
@@ -180,11 +181,12 @@
     return;
   }
 
-  if (availableComponents.size() == 0 && redirectionNames.size() == 0) {
+  if (availableComponents.empty() && redirectionNames.empty()) {
     m_face.put(generateErrorDataPacket(request.getName(), ErrorCode::INVALID_PARAMETER,
                                        "Cannot generate available names from parameters provided."));
     return;
   }
+
   std::vector<Name> availableNames;
   for (const auto &component : availableComponents) {
     Name newIdentityName = m_config.caProfile.caPrefix;
@@ -205,7 +207,6 @@
 void
 CaModule::onNewRenewRevoke(const Interest& request, RequestType requestType)
 {
-
   //verify ca cert validity
   const auto& caCert = m_keyChain.getPib()
                                  .getIdentity(m_config.caProfile.caPrefix)
@@ -338,7 +339,7 @@
   requestState.cert = *clientCert;
   // generate salt for HKDF
   std::array<uint8_t, 32> salt;
-  ndn::random::generateSecureBytes(salt.data(), salt.size());
+  ndn::random::generateSecureBytes(salt);
   // hkdf
   std::array<uint8_t, 16> aesKey;
   hkdf(sharedSecret.data(), sharedSecret.size(), salt.data(), salt.size(),
@@ -353,6 +354,7 @@
                                        "Duplicate Request ID: The same request has been seen before."));
     return;
   }
+
   Data result;
   result.setName(request.getName());
   result.setFreshnessPeriod(DEFAULT_DATA_FRESHNESS_PERIOD);
@@ -377,6 +379,7 @@
                                        "No certificate request state can be found."));
     return;
   }
+
   // verify signature
   if (!ndn::security::verifySignature(request, requestState->cert)) {
     NDN_LOG_ERROR("Invalid Signature in the Interest packet.");
@@ -384,6 +387,7 @@
                                        "Invalid Signature in the Interest packet."));
     return;
   }
+
   // decrypt the parameters
   ndn::Buffer paramTLVPayload;
   try {
@@ -398,14 +402,15 @@
                                        "Interest paramaters decryption failed."));
     return;
   }
-  if (paramTLVPayload.size() == 0) {
+  if (paramTLVPayload.empty()) {
     NDN_LOG_ERROR("No parameters are found after decryption.");
     m_storage->deleteRequest(requestState->requestId);
     m_face.put(generateErrorDataPacket(request.getName(), ErrorCode::INVALID_PARAMETER,
                                        "No parameters are found after decryption."));
     return;
   }
-  auto paramTLV = ndn::makeBinaryBlock(tlv::EncryptedPayload, paramTLVPayload.data(), paramTLVPayload.size());
+
+  auto paramTLV = ndn::makeBinaryBlock(tlv::EncryptedPayload, paramTLVPayload);
   paramTLV.parse();
 
   // load the corresponding challenge module
@@ -499,7 +504,7 @@
     return nullptr;
   }
   try {
-    NDN_LOG_TRACE("Request Id to query the database " << ndn::toHex(requestId.data(), requestId.size()));
+    NDN_LOG_TRACE("Request Id to query the database " << ndn::toHex(requestId));
     return std::make_unique<RequestState>(m_storage->getRequest(requestId));
   }
   catch (const std::exception& e) {
diff --git a/src/challenge/challenge-email.cpp b/src/challenge/challenge-email.cpp
index ea0345c..01bb7ba 100644
--- a/src/challenge/challenge-email.cpp
+++ b/src/challenge/challenge-email.cpp
@@ -51,16 +51,15 @@
     std::string emailAddress = readString(params.get(tlv::ParameterValue));
     auto lastComponentRequested = readString(request.cert.getIdentity().get(-1));
     if (lastComponentRequested != emailAddress) {
-      NDN_LOG_TRACE("Email and requested name do not match. Email " << emailAddress << " requested last component "
-                    << lastComponentRequested);
+      NDN_LOG_TRACE("Email and requested name do not match. Email " << emailAddress
+                    << " - requested last component " << lastComponentRequested);
     }
     std::string emailCode = generateSecretCode();
     JsonSection secretJson;
     secretJson.add(PARAMETER_KEY_CODE, emailCode);
     // send out the email
     sendEmail(emailAddress, emailCode, request);
-    NDN_LOG_TRACE("Secret for request " << ndn::toHex(request.requestId.data(), request.requestId.size())
-                  << " : " << emailCode);
+    NDN_LOG_TRACE("Secret for request " << ndn::toHex(request.requestId) << " : " << emailCode);
     return returnWithNewChallengeStatus(request, NEED_CODE, std::move(secretJson),
                                         m_maxAttemptTimes, m_secretLifetime);
   }
@@ -104,7 +103,7 @@
 ChallengeEmail::getRequestedParameterList(Status status, const std::string& challengeStatus)
 {
   std::multimap<std::string, std::string> result;
-  if (status == Status::BEFORE_CHALLENGE && challengeStatus == "") {
+  if (status == Status::BEFORE_CHALLENGE && challengeStatus.empty()) {
     result.emplace(PARAMETER_KEY_EMAIL, "Please input your email address");
   }
   else if (status == Status::CHALLENGE && challengeStatus == NEED_CODE) {
diff --git a/src/challenge/challenge-pin.cpp b/src/challenge/challenge-pin.cpp
index 6e42969..46f65fd 100644
--- a/src/challenge/challenge-pin.cpp
+++ b/src/challenge/challenge-pin.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /*
- * Copyright (c) 2017-2021, Regents of the University of California.
+ * Copyright (c) 2017-2022, Regents of the University of California.
  *
  * This file is part of ndncert, a certificate management system based on NDN.
  *
@@ -48,7 +48,7 @@
     std::string secretCode = generateSecretCode();
     JsonSection secretJson;
     secretJson.add(PARAMETER_KEY_CODE, secretCode);
-    NDN_LOG_TRACE("Secret for request " << ndn::toHex(request.requestId.data(), request.requestId.size())
+    NDN_LOG_TRACE("Secret for request " << ndn::toHex(request.requestId)
                   << " : " << secretCode);
     return returnWithNewChallengeStatus(request, NEED_CODE, std::move(secretJson), m_maxAttemptTimes,
                                         m_secretLifetime);
diff --git a/src/challenge/challenge-possession.cpp b/src/challenge/challenge-possession.cpp
index a7f0f77..d4c8185 100644
--- a/src/challenge/challenge-possession.cpp
+++ b/src/challenge/challenge-possession.cpp
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2017-2021, Regents of the University of California.
+ * Copyright (c) 2017-2022, Regents of the University of California.
  *
  * This file is part of ndncert, a certificate management system based on NDN.
  *
@@ -119,9 +119,8 @@
     if (credential.hasContent() && signatureLen == 0) {
       Name signingKeyName = credential.getSignatureInfo().getKeyLocator().getName();
       ndn::security::transform::PublicKey key;
-      const auto& pubKeyBuffer = credential.getPublicKey();
-      key.loadPkcs8(pubKeyBuffer.data(), pubKeyBuffer.size());
-      for (auto anchor : m_trustAnchors) {
+      key.loadPkcs8(credential.getPublicKey());
+      for (const auto& anchor : m_trustAnchors) {
         if (anchor.getKeyName() == signingKeyName) {
           if (ndn::security::verifySignature(credential, anchor)) {
             checkOK = true;
@@ -138,13 +137,12 @@
 
     // for the first time, init the challenge
     std::array<uint8_t, 16> secretCode{};
-    ndn::random::generateSecureBytes(secretCode.data(), 16);
+    ndn::random::generateSecureBytes(secretCode);
     JsonSection secretJson;
-    secretJson.add(PARAMETER_KEY_NONCE, toHex(secretCode.data(), 16));
-    auto credential_block = credential.wireEncode();
-    secretJson.add(PARAMETER_KEY_CREDENTIAL_CERT, toHex(credential_block.wire(), credential_block.size()));
-    NDN_LOG_TRACE("Secret for request " << toHex(request.requestId.data(), request.requestId.size())
-                  << " : " << toHex(secretCode.data(), 16));
+    secretJson.add(PARAMETER_KEY_NONCE, toHex(secretCode));
+    const auto& credBlock = credential.wireEncode();
+    secretJson.add(PARAMETER_KEY_CREDENTIAL_CERT, toHex({credBlock.wire(), credBlock.size()}));
+    NDN_LOG_TRACE("Secret for request " << toHex(request.requestId) << " : " << toHex(secretCode));
     return returnWithNewChallengeStatus(request, NEED_PROOF, std::move(secretJson), m_maxAttemptTimes, m_secretLifetime);
   }
   else if (request.challengeState && request.challengeState->challengeStatus == NEED_PROOF) {
@@ -158,9 +156,8 @@
 
     //check the proof
     ndn::security::transform::PublicKey key;
-    const auto& pubKeyBuffer = credential.getPublicKey();
-    key.loadPkcs8(pubKeyBuffer.data(), pubKeyBuffer.size());
-    if (ndn::security::verifySignature({{secretCode.data(), secretCode.size()}}, signature, signatureLen, key)) {
+    key.loadPkcs8(credential.getPublicKey());
+    if (ndn::security::verifySignature({secretCode}, {signature, signatureLen}, key)) {
       return returnWithSuccess(request);
     }
     return returnWithError(request, ErrorCode::INVALID_PARAMETER,
@@ -203,7 +200,8 @@
         request.push_back(ndn::makeStringBlock(tlv::ParameterKey, PARAMETER_KEY_CREDENTIAL_CERT));
         Block valueBlock(tlv::ParameterValue);
         auto& certTlvStr = std::get<1>(item);
-        valueBlock.push_back(Block(reinterpret_cast<const uint8_t*>(certTlvStr.data()), certTlvStr.size()));
+        valueBlock.push_back(Block(ndn::make_span(reinterpret_cast<const uint8_t*>(certTlvStr.data()),
+                                                  certTlvStr.size())));
         request.push_back(valueBlock);
       }
       else {
@@ -219,9 +217,7 @@
       if (std::get<0>(item) == PARAMETER_KEY_PROOF) {
         request.push_back(ndn::makeStringBlock(tlv::ParameterKey, PARAMETER_KEY_PROOF));
         auto& sigTlvStr = std::get<1>(item);
-        auto valueBlock = ndn::makeBinaryBlock(tlv::ParameterValue,
-                                               reinterpret_cast<const uint8_t*>(sigTlvStr.data()),
-                                               sigTlvStr.size());
+        auto valueBlock = ndn::makeBinaryBlock(tlv::ParameterValue, sigTlvStr.data(), sigTlvStr.size());
         request.push_back(valueBlock);
       }
       else {
@@ -244,8 +240,8 @@
   auto keyName = ndn::security::extractKeyNameFromCertName(issuedCertName);
   auto id = keyChain.getPib().getIdentity(ndn::security::extractIdentityFromCertName(issuedCertName));
   auto issuedCert = id.getKey(keyName).getCertificate(issuedCertName);
-  auto issuedCertTlv = issuedCert.wireEncode();
-  auto signature = keyChain.getTpm().sign({{nonce.data(), nonce.size()}}, keyName, ndn::DigestAlgorithm::SHA256);
+  const auto& issuedCertTlv = issuedCert.wireEncode();
+  auto signature = keyChain.getTpm().sign({nonce}, keyName, ndn::DigestAlgorithm::SHA256);
 
   for (auto& item : params) {
     if (item.first == PARAMETER_KEY_CREDENTIAL_CERT) {
diff --git a/src/detail/ca-memory.cpp b/src/detail/ca-memory.cpp
index eae67cc..b3c5efd 100644
--- a/src/detail/ca-memory.cpp
+++ b/src/detail/ca-memory.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /*
- * Copyright (c) 2017-2021, Regents of the University of California.
+ * Copyright (c) 2017-2022, Regents of the University of California.
  *
  * This file is part of ndncert, a certificate management system based on NDN.
  *
@@ -36,8 +36,7 @@
 {
   auto search = m_requests.find(requestId);
   if (search == m_requests.end()) {
-    NDN_THROW(std::runtime_error("Request " + ndn::toHex(requestId.data(), requestId.size()) +
-                                 " does not exists"));
+    NDN_THROW(std::runtime_error("Request " + ndn::toHex(requestId) + " does not exists"));
   }
   return search->second;
 }
@@ -50,8 +49,7 @@
     m_requests.insert(std::make_pair(request.requestId, request));
   }
   else {
-    NDN_THROW(std::runtime_error("Request " + ndn::toHex(request.requestId.data(), request.requestId.size()) +
-                                 " already exists"));
+    NDN_THROW(std::runtime_error("Request " + ndn::toHex(request.requestId) + " already exists"));
   }
 }
 
diff --git a/src/detail/ca-request-state.cpp b/src/detail/ca-request-state.cpp
index 68d189a..63ac317 100644
--- a/src/detail/ca-request-state.cpp
+++ b/src/detail/ca-request-state.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /*
- * Copyright (c) 2017-2021, Regents of the University of California.
+ * Copyright (c) 2017-2022, Regents of the University of California.
  *
  * This file is part of ndncert, a certificate management system based on NDN.
  *
@@ -71,7 +71,7 @@
 operator<<(std::ostream& os, const RequestState& request)
 {
   os << "Request's CA name: " << request.caPrefix << "\n";
-  os << "Request's request ID: " << ndn::toHex(request.requestId.data(), request.requestId.size()) << "\n";
+  os << "Request's request ID: " << ndn::toHex(request.requestId) << "\n";
   os << "Request's status: " << statusToString(request.status) << "\n";
   os << "Request's challenge type: " << request.challengeType << "\n";
   if (request.challengeState) {
diff --git a/src/detail/ca-sqlite.cpp b/src/detail/ca-sqlite.cpp
index 45cd84d..0632edc 100644
--- a/src/detail/ca-sqlite.cpp
+++ b/src/detail/ca-sqlite.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /*
- * Copyright (c) 2017-2021, Regents of the University of California.
+ * Copyright (c) 2017-2022, Regents of the University of California.
  *
  * This file is part of ndncert, a certificate management system based on NDN.
  *
@@ -157,8 +157,7 @@
     return state;
   }
   else {
-    NDN_THROW(std::runtime_error("Request " + ndn::toHex(requestId.data(), requestId.size()) +
-                                 " cannot be fetched from database"));
+    NDN_THROW(std::runtime_error("Request " + ndn::toHex(requestId) + " cannot be fetched from database"));
   }
 }
 
@@ -188,8 +187,8 @@
     statement.bind(11, request.challengeState->remainingTime.count());
   }
   if (statement.step() != SQLITE_DONE) {
-    NDN_THROW(std::runtime_error("Request " + ndn::toHex(request.requestId.data(), request.requestId.size()) +
-                                 " cannot be added to database"));
+    NDN_THROW(std::runtime_error("Request " + ndn::toHex(request.requestId) +
+                                 " cannot be added to the database"));
   }
 }
 
diff --git a/src/detail/challenge-encoder.cpp b/src/detail/challenge-encoder.cpp
index c2bdd68..1a7a83d 100644
--- a/src/detail/challenge-encoder.cpp
+++ b/src/detail/challenge-encoder.cpp
@@ -36,7 +36,7 @@
     if (request.challengeState->challengeStatus == "need-proof") {
       response.push_back(ndn::makeStringBlock(tlv::ParameterKey, "nonce"));
       auto nonce = ndn::fromHex(request.challengeState->secrets.get("nonce", ""));
-      response.push_back(ndn::makeBinaryBlock(tlv::ParameterValue, nonce->data(), 16));
+      response.push_back(ndn::makeBinaryBlock(tlv::ParameterValue, *nonce));
     }
   }
   if (!issuedCertName.empty()) {
@@ -57,7 +57,7 @@
   auto result = decodeBlockWithAesGcm128(contentBlock, state.m_aesKey.data(),
                                          state.m_requestId.data(), state.m_requestId.size(),
                                          state.m_decryptionIv, state.m_encryptionIv);
-  auto data = ndn::makeBinaryBlock(tlv::EncryptedPayload, result.data(), result.size());
+  auto data = ndn::makeBinaryBlock(tlv::EncryptedPayload, result);
   data.parse();
 
   int numStatus = 0;
diff --git a/src/detail/crypto-helpers.cpp b/src/detail/crypto-helpers.cpp
index d0c2e55..16e56a5 100644
--- a/src/detail/crypto-helpers.cpp
+++ b/src/detail/crypto-helpers.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /*
- * Copyright (c) 2017-2021, Regents of the University of California.
+ * Copyright (c) 2017-2022, Regents of the University of California.
  *
  * This file is part of ndncert, a certificate management system based on NDN.
  *
@@ -416,17 +416,20 @@
   // The spec of AES encrypted payload TLV used in NDNCERT:
   //   https://github.com/named-data/ndncert/wiki/NDNCERT-Protocol-0.3#242-aes-gcm-encryption
   ndn::Buffer encryptedPayload(payloadSize);
-  uint8_t tag[16];
   if (encryptionIv.empty()) {
     encryptionIv.resize(12, 0);
-    ndn::random::generateSecureBytes(encryptionIv.data(), 8);
+    ndn::random::generateSecureBytes(ndn::make_span(encryptionIv).first(8));
   }
+
+  uint8_t tag[16];
   size_t encryptedPayloadLen = aesGcm128Encrypt(payload, payloadSize, associatedData, associatedDataSize,
                                                 key, encryptionIv.data(), encryptedPayload.data(), tag);
+
   Block content(tlvType);
-  content.push_back(ndn::makeBinaryBlock(tlv::InitializationVector, encryptionIv.data(), encryptionIv.size()));
-  content.push_back(ndn::makeBinaryBlock(tlv::AuthenticationTag, tag, 16));
-  content.push_back(ndn::makeBinaryBlock(tlv::EncryptedPayload, encryptedPayload.data(), encryptedPayloadLen));
+  content.push_back(ndn::makeBinaryBlock(tlv::InitializationVector, encryptionIv));
+  content.push_back(ndn::makeBinaryBlock(tlv::AuthenticationTag, tag));
+  content.push_back(ndn::makeBinaryBlock(tlv::EncryptedPayload,
+                                         ndn::make_span(encryptedPayload).first(encryptedPayloadLen)));
   content.encode();
   // update IV's counter
   updateIv(encryptionIv, payloadSize);
diff --git a/src/detail/request-encoder.cpp b/src/detail/request-encoder.cpp
index fde2d86..1187243 100644
--- a/src/detail/request-encoder.cpp
+++ b/src/detail/request-encoder.cpp
@@ -31,9 +31,8 @@
                                         const std::vector<uint8_t>& ecdhPub,
                                         const Certificate& certRequest)
 {
-  Block
-  request(ndn::tlv::ApplicationParameters);
-  request.push_back(ndn::makeBinaryBlock(tlv::EcdhPub, ecdhPub.data(), ecdhPub.size()));
+  Block request(ndn::tlv::ApplicationParameters);
+  request.push_back(ndn::makeBinaryBlock(tlv::EcdhPub, ecdhPub));
   if (requestType == RequestType::NEW || requestType == RequestType::RENEW) {
     request.push_back(makeNestedBlock(tlv::CertRequest, certRequest));
   }
@@ -83,14 +82,15 @@
 }
 
 Block
-requesttlv::encodeDataContent(const std::vector <uint8_t>& ecdhKey, const std::array<uint8_t, 32>& salt,
+requesttlv::encodeDataContent(const std::vector<uint8_t>& ecdhKey,
+                              const std::array<uint8_t, 32>& salt,
                               const RequestId& requestId,
-                              const std::vector <std::string>& challenges)
+                              const std::vector<std::string>& challenges)
 {
   Block response(ndn::tlv::Content);
-  response.push_back(ndn::makeBinaryBlock(tlv::EcdhPub, ecdhKey.data(), ecdhKey.size()));
-  response.push_back(ndn::makeBinaryBlock(tlv::Salt, salt.data(), salt.size()));
-  response.push_back(ndn::makeBinaryBlock(tlv::RequestId, requestId.data(), requestId.size()));
+  response.push_back(ndn::makeBinaryBlock(tlv::EcdhPub, ecdhKey));
+  response.push_back(ndn::makeBinaryBlock(tlv::Salt, salt));
+  response.push_back(ndn::makeBinaryBlock(tlv::RequestId, requestId));
   for (const auto& entry: challenges) {
     response.push_back(ndn::makeStringBlock(tlv::Challenge, entry));
   }
diff --git a/src/requester-request.cpp b/src/requester-request.cpp
index 60442c1..4e6d654 100644
--- a/src/requester-request.cpp
+++ b/src/requester-request.cpp
@@ -140,7 +140,7 @@
   Certificate certRequest;
   certRequest.setName(Name(keyName).append("cert-request").appendVersion());
   certRequest.setContentType(ndn::tlv::ContentType_Key);
-  certRequest.setContent(m_keyPair.getPublicKey().data(), m_keyPair.getPublicKey().size());
+  certRequest.setContent(m_keyPair.getPublicKey());
   SignatureInfo signatureInfo;
   signatureInfo.setValidityPeriod(ndn::security::ValidityPeriod(notBefore, notAfter));
   m_keyChain.sign(certRequest, signingByKey(keyName).setSignatureInfo(signatureInfo));
@@ -213,7 +213,7 @@
 std::shared_ptr<Interest>
 Request::genChallengeInterest(std::multimap<std::string, std::string>&& parameters)
 {
-  if (m_challengeType == "") {
+  if (m_challengeType.empty()) {
     NDN_THROW(std::runtime_error("The challenge has not been selected."));
   }
   auto challenge = ChallengeModule::createChallengeModule(m_challengeType);
@@ -223,7 +223,7 @@
   auto challengeParams = challenge->genChallengeRequestTLV(m_status, m_challengeStatus, std::move(parameters));
 
   Name interestName = m_caProfile.caPrefix;
-  interestName.append("CA").append("CHALLENGE").append(m_requestId.data(), m_requestId.size());
+  interestName.append("CA").append("CHALLENGE").append(Name::Component(m_requestId));
   auto interest = std::make_shared<Interest>(interestName);
   interest->setMustBeFresh(true);
 
diff --git a/tests/identity-management-fixture.cpp b/tests/identity-management-fixture.cpp
index c4a4590..254da23 100644
--- a/tests/identity-management-fixture.cpp
+++ b/tests/identity-management-fixture.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /*
- * Copyright (c) 2013-2021 Regents of the University of California.
+ * Copyright (c) 2013-2022 Regents of the University of California.
  *
  * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
  *
@@ -115,7 +115,7 @@
   certificate.setFreshnessPeriod(1_h);
 
   // set content
-  certificate.setContent(key.getPublicKey().data(), key.getPublicKey().size());
+  certificate.setContent(key.getPublicKey());
 
   // set signature-info
   SignatureInfo info;
diff --git a/tests/unit-tests/ca-module.t.cpp b/tests/unit-tests/ca-module.t.cpp
index 73a722f..3d76678 100644
--- a/tests/unit-tests/ca-module.t.cpp
+++ b/tests/unit-tests/ca-module.t.cpp
@@ -302,7 +302,7 @@
   Certificate cert;
   cert.setName(Name(key.getName()).append("self-sign").appendVersion());
   cert.setContentType(ndn::tlv::ContentType_Key);
-  cert.setContent(key.getPublicKey().data(), key.getPublicKey().size());
+  cert.setContent(key.getPublicKey());
   SignatureInfo signatureInfo;
   signatureInfo.setValidityPeriod(ndn::security::ValidityPeriod(time::system_clock::now() - time::days(1),
                                                                 time::system_clock::now() - time::seconds(1)));
@@ -497,7 +497,7 @@
   clientCert.setName(Name(clientKey.getName()).append("cert-request").appendVersion());
   clientCert.setContentType(ndn::tlv::ContentType_Key);
   clientCert.setFreshnessPeriod(time::hours(24));
-  clientCert.setContent(clientKey.getPublicKey().data(), clientKey.getPublicKey().size());
+  clientCert.setContent(clientKey.getPublicKey());
   SignatureInfo signatureInfo;
   signatureInfo.setValidityPeriod(ndn::security::ValidityPeriod(time::system_clock::now(),
                                                                 time::system_clock::now() + time::hours(10)));
@@ -568,7 +568,7 @@
   clientCert.setName(Name(clientKey.getName()).append("NDNCERT").append("1473283247810732701"));
   clientCert.setContentType(ndn::tlv::ContentType_Key);
   clientCert.setFreshnessPeriod(time::hours(24));
-  clientCert.setContent(clientKey.getPublicKey().data(), clientKey.getPublicKey().size());
+  clientCert.setContent(clientKey.getPublicKey());
   SignatureInfo signatureInfo;
   signatureInfo.setValidityPeriod(ndn::security::ValidityPeriod(time::system_clock::now(),
                                                                 time::system_clock::now() + time::hours(10)));
diff --git a/tests/unit-tests/challenge-possession.t.cpp b/tests/unit-tests/challenge-possession.t.cpp
index 2c76c3d..0a25577 100644
--- a/tests/unit-tests/challenge-possession.t.cpp
+++ b/tests/unit-tests/challenge-possession.t.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /*
- * Copyright (c) 2017-2021, Regents of the University of California.
+ * Copyright (c) 2017-2022, Regents of the University of California.
  *
  * This file is part of ndncert, a certificate management system based on NDN.
  *
@@ -66,7 +66,7 @@
   auto credentialName = Name(keyB.getName()).append("Credential").appendVersion();
   Certificate credential;
   credential.setName(credentialName);
-  credential.setContent(keyB.getPublicKey().data(), keyB.getPublicKey().size());
+  credential.setContent(keyB.getPublicKey());
   SignatureInfo signatureInfo;
   signatureInfo.setValidityPeriod(ndn::security::ValidityPeriod(time::system_clock::now(),
                                                                 time::system_clock::now() + time::minutes(1)));
@@ -119,7 +119,7 @@
   auto credentialName = Name(keyB.getName()).append("Credential").appendVersion();
   Certificate credential;
   credential.setName(credentialName);
-  credential.setContent(keyB.getPublicKey().data(), keyB.getPublicKey().size());
+  credential.setContent(keyB.getPublicKey());
   SignatureInfo signatureInfo;
   signatureInfo.setValidityPeriod(ndn::security::ValidityPeriod(time::system_clock::now(),
                                                                 time::system_clock::now() + time::minutes(1)));
diff --git a/wscript b/wscript
index 1c430b1..a3b2c88 100644
--- a/wscript
+++ b/wscript
@@ -3,7 +3,7 @@
 from waflib import Utils
 import os
 
-VERSION = '0.1.0'
+VERSION = '0.1'
 APPNAME = 'ndncert'
 GIT_TAG_PREFIX = 'ndncert-'
 
@@ -23,8 +23,9 @@
 
     conf.env.WITH_TESTS = conf.options.with_tests
 
-    conf.check_cfg(package='libndn-cxx', args=['--cflags', '--libs'], uselib_store='NDN_CXX',
-                   pkg_config_path=os.environ.get('PKG_CONFIG_PATH', '%s/pkgconfig' % conf.env.LIBDIR))
+    pkg_config_path = os.environ.get('PKG_CONFIG_PATH', f'{conf.env.LIBDIR}/pkgconfig')
+    conf.check_cfg(package='libndn-cxx', args=['libndn-cxx >= 0.8.0', '--cflags', '--libs'],
+                   uselib_store='NDN_CXX', pkg_config_path=pkg_config_path)
 
     conf.check_sqlite3()
     conf.check_openssl(lib='crypto', atleast_version='1.1.1')
