Avoid deprecated ndn-cxx functions

Change-Id: Ib148262999a691760821a2ce1c05a5e6332e7e34
diff --git a/src/access-manager.cpp b/src/access-manager.cpp
index a759f2d..3602c98 100644
--- a/src/access-manager.cpp
+++ b/src/access-manager.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /*
- * Copyright (c) 2014-2020, Regents of the University of California
+ * Copyright (c) 2014-2022, Regents of the University of California
  *
  * NAC library is free software: you can redistribute it and/or modify it under the
  * terms of the GNU Lesser General Public License as published by the Free Software
@@ -87,7 +87,7 @@
 
   const size_t secretLength = 32;
   uint8_t secret[secretLength + 1];
-  random::generateSecureBytes(secret, secretLength);
+  random::generateSecureBytes({secret, secretLength});
   // because of stupid bug in ndn-cxx, remove all \0 in generated secret, replace with 1
   for (size_t i = 0; i < secretLength; ++i) {
     if (secret[i] == 0) {
@@ -100,11 +100,11 @@
                                           reinterpret_cast<const char*>(secret), secretLength);
 
   PublicKey memberKey;
-  memberKey.loadPkcs8(memberCert.getPublicKey().data(), memberCert.getPublicKey().size());
+  memberKey.loadPkcs8(memberCert.getPublicKey());
 
   EncryptedContent content;
   content.setPayload(kdkData->wireEncode());
-  content.setPayloadKey(memberKey.encrypt(secret, secretLength));
+  content.setPayloadKey(memberKey.encrypt({secret, secretLength}));
 
   auto kdk = make_shared<Data>(kdkName);
   kdk->setContent(content.wireEncode());