Add default constructor in CertificateRequest
When fetch CertificateRequest instance from storage, we may want a default constructor to create an empty instance.
Change-Id: I3be7517465fc912813282d7b40f9de3d9422cb70
diff --git a/src/certificate-request.hpp b/src/certificate-request.hpp
index 35fb2f7..26fd9da 100644
--- a/src/certificate-request.hpp
+++ b/src/certificate-request.hpp
@@ -18,8 +18,8 @@
* See AUTHORS.md for complete list of ndncert authors and contributors.
*/
-#ifndef NDNCERT_CERTFICATE_REQUEST_HPP
-#define NDNCERT_CERTFICATE_REQUEST_HPP
+#ifndef NDNCERT_CERTIFICATE_REQUEST_HPP
+#define NDNCERT_CERTIFICATE_REQUEST_HPP
#include "ndncert-common.hpp"
#include <ndn-cxx/security/v2/certificate.hpp>
@@ -39,6 +39,8 @@
class CertificateRequest
{
public:
+ CertificateRequest();
+
CertificateRequest(const Name& caName, const std::string& requestId,
const security::v2::Certificate& cert);
@@ -101,6 +103,12 @@
m_challengeSecrets = challengeSecrets;
}
+ bool
+ isEmpty()
+ {
+ return m_requestId == "";
+ }
+
private:
Name m_caName;
std::string m_requestId;
@@ -123,4 +131,4 @@
} // namespace ndncert
} // namespace ndn
-#endif // NDNCERT_CERTFICATE_REQUEST_HPP
+#endif // NDNCERT_CERTIFICATE_REQUEST_HPP