security: Reorganizing source code to prepare for support of two version of NDN certificates
This commit also removes unused ndn_digestSha256 function and deprecates
crypto::sha256 in favor of crypto::computeSha256Digest in util/crypto.hpp.
Change-Id: I24ee50ff073a96b868633bdf2cfade412d3605f3
Refs: #3098
diff --git a/tools/ndnsec/dsk-gen.hpp b/tools/ndnsec/dsk-gen.hpp
index 80a31ed..4f994c3 100644
--- a/tools/ndnsec/dsk-gen.hpp
+++ b/tools/ndnsec/dsk-gen.hpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/**
- * Copyright (c) 2013-2015 Regents of the University of California.
+ * Copyright (c) 2013-2016 Regents of the University of California.
*
* This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
*
@@ -30,6 +30,7 @@
ndnsec_dsk_gen(int argc, char** argv)
{
using namespace ndn;
+ using namespace ndn::security;
namespace po = boost::program_options;
std::string identityName;
@@ -73,7 +74,7 @@
return 1;
}
- shared_ptr<IdentityCertificate> kskCert;
+ shared_ptr<v1::IdentityCertificate> kskCert;
Name signingCertName;
KeyChain keyChain;
@@ -92,14 +93,14 @@
}
if (isDefaultDsk) {
- shared_ptr<IdentityCertificate> dskCert = keyChain.getCertificate(defaultCertName);
+ shared_ptr<v1::IdentityCertificate> dskCert = keyChain.getCertificate(defaultCertName);
if (static_cast<bool>(dskCert)) {
SignatureSha256WithRsa sha256sig(dskCert->getSignature());
Name keyLocatorName = sha256sig.getKeyLocator().getName();
- Name kskName = IdentityCertificate::certificateNameToPublicKeyName(keyLocatorName);
+ Name kskName = v1::IdentityCertificate::certificateNameToPublicKeyName(keyLocatorName);
Name kskCertName = keyChain.getDefaultCertificateNameForKey(kskName);
signingCertName = kskCertName;
kskCert = keyChain.getCertificate(kskCertName);
@@ -153,7 +154,7 @@
.append("ID-CERT")
.appendVersion();
- shared_ptr<IdentityCertificate> certificate =
+ shared_ptr<v1::IdentityCertificate> certificate =
keyChain.prepareUnsignedIdentityCertificate(newKeyName,
Name(identityName),
kskCert->getNotBefore(),