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/key.hpp b/src/security/key.hpp
index 31d7fe7..a237a38 100644
--- a/src/security/key.hpp
+++ b/src/security/key.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).
*
@@ -22,7 +22,7 @@
#ifndef NDN_SECURITY_KEY_HPP
#define NDN_SECURITY_KEY_HPP
-#include "identity-certificate.hpp"
+#include "v1/identity-certificate.hpp"
#include "certificate-container.hpp"
namespace ndn {
@@ -83,7 +83,7 @@
getKeyId() const;
/// @brief Get public key
- const PublicKey&
+ const v1::PublicKey&
getPublicKey() const;
/**
@@ -92,7 +92,7 @@
* @return the certificate
* @throws Pib::Error if the certificate does not exist.
*/
- IdentityCertificate
+ v1::IdentityCertificate
getCertificate(const Name& certName) const;
/// @brief Get all the certificates for this key.
@@ -104,7 +104,7 @@
*
* @throws Pib::Error if the default certificate does not exist.
*/
- const IdentityCertificate&
+ const v1::IdentityCertificate&
getDefaultCertificate() const;
/// @brief Check if the Key instance is valid
@@ -122,7 +122,7 @@
* @param certificate The certificate to add.
*/
void
- addCertificate(const IdentityCertificate& certificate);
+ addCertificate(const v1::IdentityCertificate& certificate);
/**
* @brief Remove a certificate.
@@ -139,7 +139,7 @@
* @return the default certificate
* @throws Pib::Error if the certificate does not exist.
*/
- const IdentityCertificate&
+ const v1::IdentityCertificate&
setDefaultCertificate(const Name& certName);
/**
@@ -151,8 +151,8 @@
* @param certificate The certificate to add.
* @return the default certificate
*/
- const IdentityCertificate&
- setDefaultCertificate(const IdentityCertificate& certificate);
+ const v1::IdentityCertificate&
+ setDefaultCertificate(const v1::IdentityCertificate& certificate);
NDN_CXX_PUBLIC_WITH_TESTS_ELSE_PRIVATE:
/**
@@ -166,7 +166,7 @@
* @param impl The actual backend implementation.
*/
Key(const Name& identityName, const name::Component& keyId,
- const PublicKey& publicKey, shared_ptr<PibImpl> impl);
+ const v1::PublicKey& publicKey, shared_ptr<PibImpl> impl);
/**
* @brief Create an KeyEntry with @p identityName and @p keyId.
@@ -190,10 +190,10 @@
Name m_id;
name::Component m_keyId;
Name m_keyName;
- PublicKey m_key;
+ v1::PublicKey m_key;
mutable bool m_hasDefaultCertificate;
- mutable IdentityCertificate m_defaultCertificate;
+ mutable v1::IdentityCertificate m_defaultCertificate;
mutable bool m_needRefreshCerts;
mutable CertificateContainer m_certificates;