Add build system, basic docs and crypto helpers module
Change-Id: I761cde5adac85596c5a3a53ec3e94a9a81fb5416
diff --git a/src/detail/ndncert-common.cpp b/src/detail/ndncert-common.cpp
new file mode 100644
index 0000000..7c210b7
--- /dev/null
+++ b/src/detail/ndncert-common.cpp
@@ -0,0 +1,59 @@
+/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
+/**
+ * Copyright (c) 2017-2020, Regents of the University of California.
+ *
+ * This file is part of ndncert, a certificate management system based on NDN.
+ *
+ * ndncert is free software: you can redistribute it and/or modify it under the terms
+ * of the GNU General Public License as published by the Free Software Foundation, either
+ * version 3 of the License, or (at your option) any later version.
+ *
+ * ndncert is distributed in the hope that it will be useful, but WITHOUT ANY
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+ * PARTICULAR PURPOSE. See the GNU General Public License for more details.
+ *
+ * You should have received copies of the GNU General Public License along with
+ * ndncert, e.g., in COPYING.md file. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * See AUTHORS.md for complete list of ndncert authors and contributors.
+ */
+
+#include "detail/ndncert-common.hpp"
+
+namespace ndn {
+namespace ndncert {
+
+std::ostream&
+operator<<(std::ostream& out, ErrorCode code)
+{
+ switch (code) {
+ case ErrorCode::NO_ERROR: out << "NO_ERROR"; break;
+ case ErrorCode::BAD_INTEREST_FORMAT: out << "BAD_INTEREST_FORMAT"; break;
+ case ErrorCode::BAD_PARAMETER_FORMAT: out << "BAD_PARAMETER_FORMAT"; break;
+ case ErrorCode::BAD_SIGNATURE: out << "BAD_SIGNATURE"; break;
+ case ErrorCode::INVALID_PARAMETER: out << "INVALID_PARAMETER"; break;
+ case ErrorCode::NAME_NOT_ALLOWED: out << "NAME_NOT_ALLOWED"; break;
+ case ErrorCode::BAD_VALIDITY_PERIOD: out << "BAD_VALIDITY_PERIOD"; break;
+ case ErrorCode::OUT_OF_TRIES: out << "OUT_OF_TRIES"; break;
+ case ErrorCode::OUT_OF_TIME: out << "OUT_OF_TIME"; break;
+ case ErrorCode::NO_AVAILABLE_NAMES: out << "NO_AVAILABLE_NAMES"; break;
+ default: out << "UNKNOWN_ERROR"; break;
+ }
+ return out;
+}
+
+std::ostream&
+operator<<(std::ostream& out, RequestType type)
+{
+ switch (type) {
+ case RequestType::NEW: out << "New"; break;
+ case RequestType::RENEW: out << "Renew"; break;
+ case RequestType::REVOKE: out << "Revoke"; break;
+ case RequestType::NOTINITIALIZED: out << "Not Initialized"; break;
+ default: out << "UNKNOWN_REQUEST_TYPE"; break;
+ }
+ return out;
+}
+
+} // namespace ndncert
+} // namespace ndn