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/encoding/oid.hpp b/src/encoding/oid.hpp
index d5f99ca..2f89484 100644
--- a/src/encoding/oid.hpp
+++ b/src/encoding/oid.hpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/**
- * Copyright (c) 2013-2014 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).
*
@@ -28,25 +28,23 @@
namespace CryptoPP {
class BufferedTransformation;
-}
+} // namespace CryptoPP
namespace ndn {
-class OID
+class Oid
{
public:
- OID()
- {
- }
+ Oid() = default;
explicit
- OID(const char* oid);
+ Oid(const char* oid);
explicit
- OID(const std::string& oid);
+ Oid(const std::string& oid);
explicit
- OID(const std::vector<int>& oid)
+ Oid(const std::vector<int>& oid)
: m_oid(oid)
{
}
@@ -67,13 +65,13 @@
toString() const;
bool
- operator==(const OID& oid) const
+ operator==(const Oid& oid) const
{
return equal(oid);
}
bool
- operator!=(const OID& oid) const
+ operator!=(const Oid& oid) const
{
return !equal(oid);
}
@@ -86,25 +84,27 @@
private:
- void
- construct(const std::string& value);
-
bool
- equal(const OID& oid) const;
+ equal(const Oid& oid) const;
private:
std::vector<int> m_oid;
};
+/**
+ * @deprecated Use Oid type instead
+ */
+typedef Oid OID;
+
namespace oid {
-//crypto algorithm
-extern const OID RSA;
-extern const OID ECDSA;
+// crypto algorithm
+extern const Oid RSA;
+extern const Oid ECDSA;
-//certificate entries
-extern const OID ATTRIBUTE_NAME;
-}
+// certificate entries
+extern const Oid ATTRIBUTE_NAME;
+} // namespace oid
-}
+} // namespace ndn
#endif // NDN_ENCODING_OID_HPP