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/src/security/pib-memory.cpp b/src/security/pib-memory.cpp
index 09300f1..c472863 100644
--- a/src/security/pib-memory.cpp
+++ b/src/security/pib-memory.cpp
@@ -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).
*
@@ -102,7 +102,7 @@
}
void
-PibMemory::addKey(const Name& identity, const name::Component& keyId, const PublicKey& publicKey)
+PibMemory::addKey(const Name& identity, const name::Component& keyId, const v1::PublicKey& publicKey)
{
this->addIdentity(identity);
@@ -127,7 +127,7 @@
}
}
-PublicKey
+v1::PublicKey
PibMemory::getKeyBits(const Name& identity, const name::Component& keyId) const
{
if (!hasKey(identity, keyId))
@@ -184,7 +184,7 @@
}
void
-PibMemory::addCertificate(const IdentityCertificate& certificate)
+PibMemory::addCertificate(const v1::IdentityCertificate& certificate)
{
this->addKey(certificate.getPublicKeyName().getPrefix(-1),
certificate.getPublicKeyName().get(-1),
@@ -201,10 +201,10 @@
PibMemory::removeCertificate(const Name& certName)
{
m_certs.erase(certName);
- m_defaultCert.erase(IdentityCertificate::certificateNameToPublicKeyName(certName));
+ m_defaultCert.erase(v1::IdentityCertificate::certificateNameToPublicKeyName(certName));
}
-IdentityCertificate
+v1::IdentityCertificate
PibMemory::getCertificate(const Name& certName) const
{
if (!hasCertificate(certName))
@@ -237,7 +237,7 @@
m_defaultCert[keyName] = certName;
}
-IdentityCertificate
+v1::IdentityCertificate
PibMemory::getDefaultCertificateOfKey(const Name& identity, const name::Component& keyId) const
{
Name keyName = getKeyName(identity, keyId);