Avoid deprecated ndn-cxx functions

Change-Id: Idcef8a642affb276581397e869d19534ec776240
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)));