security: Added NoVerifyPolicyManager.
diff --git a/Makefile.am b/Makefile.am
index e5c3026..4efdccc 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -74,6 +74,8 @@
   ndn-cpp/security/identity/memory-identity-storage.cpp ndn-cpp/security/identity/memory-identity-storage.hpp \
   ndn-cpp/security/identity/memory-private-key-storage.cpp ndn-cpp/security/identity/memory-private-key-storage.hpp \
   ndn-cpp/security/identity/private-key-storage.hpp \
+  ndn-cpp/security/policy/no-verify-policy-manager.cpp ndn-cpp/security/policy/no-verify-policy-manager.hpp \
+  ndn-cpp/security/policy/policy-manager.hpp \
   ndn-cpp/c/transport/socket-transport.h ndn-cpp/c/transport/tcp-transport.h ndn-cpp/transport/tcp-transport.cpp ndn-cpp/transport/tcp-transport.hpp \
   ndn-cpp/transport/transport.cpp ndn-cpp/transport/transport.hpp \
   ndn-cpp/c/transport/socket-transport.h ndn-cpp/c/transport/udp-transport.h ndn-cpp/transport/udp-transport.cpp ndn-cpp/transport/udp-transport.hpp \
diff --git a/Makefile.in b/Makefile.in
index 5da1931..7a3de7e 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -166,6 +166,7 @@
 	ndn-cpp/security/identity/identity-manager.lo \
 	ndn-cpp/security/identity/memory-identity-storage.lo \
 	ndn-cpp/security/identity/memory-private-key-storage.lo \
+	ndn-cpp/security/policy/no-verify-policy-manager.lo \
 	ndn-cpp/transport/tcp-transport.lo \
 	ndn-cpp/transport/transport.lo \
 	ndn-cpp/transport/udp-transport.lo \
@@ -538,6 +539,8 @@
   ndn-cpp/security/identity/memory-identity-storage.cpp ndn-cpp/security/identity/memory-identity-storage.hpp \
   ndn-cpp/security/identity/memory-private-key-storage.cpp ndn-cpp/security/identity/memory-private-key-storage.hpp \
   ndn-cpp/security/identity/private-key-storage.hpp \
+  ndn-cpp/security/policy/no-verify-policy-manager.cpp ndn-cpp/security/policy/no-verify-policy-manager.hpp \
+  ndn-cpp/security/policy/policy-manager.hpp \
   ndn-cpp/c/transport/socket-transport.h ndn-cpp/c/transport/tcp-transport.h ndn-cpp/transport/tcp-transport.cpp ndn-cpp/transport/tcp-transport.hpp \
   ndn-cpp/transport/transport.cpp ndn-cpp/transport/transport.hpp \
   ndn-cpp/c/transport/socket-transport.h ndn-cpp/c/transport/udp-transport.h ndn-cpp/transport/udp-transport.cpp ndn-cpp/transport/udp-transport.hpp \
@@ -798,6 +801,15 @@
 ndn-cpp/security/identity/memory-private-key-storage.lo:  \
 	ndn-cpp/security/identity/$(am__dirstamp) \
 	ndn-cpp/security/identity/$(DEPDIR)/$(am__dirstamp)
+ndn-cpp/security/policy/$(am__dirstamp):
+	@$(MKDIR_P) ndn-cpp/security/policy
+	@: > ndn-cpp/security/policy/$(am__dirstamp)
+ndn-cpp/security/policy/$(DEPDIR)/$(am__dirstamp):
+	@$(MKDIR_P) ndn-cpp/security/policy/$(DEPDIR)
+	@: > ndn-cpp/security/policy/$(DEPDIR)/$(am__dirstamp)
+ndn-cpp/security/policy/no-verify-policy-manager.lo:  \
+	ndn-cpp/security/policy/$(am__dirstamp) \
+	ndn-cpp/security/policy/$(DEPDIR)/$(am__dirstamp)
 ndn-cpp/transport/$(am__dirstamp):
 	@$(MKDIR_P) ndn-cpp/transport
 	@: > ndn-cpp/transport/$(am__dirstamp)
@@ -934,6 +946,8 @@
 	-rm -f ndn-cpp/security/certificate/*.lo
 	-rm -f ndn-cpp/security/identity/*.$(OBJEXT)
 	-rm -f ndn-cpp/security/identity/*.lo
+	-rm -f ndn-cpp/security/policy/*.$(OBJEXT)
+	-rm -f ndn-cpp/security/policy/*.lo
 	-rm -f ndn-cpp/transport/*.$(OBJEXT)
 	-rm -f ndn-cpp/transport/*.lo
 	-rm -f ndn-cpp/util/*.$(OBJEXT)
@@ -980,6 +994,7 @@
 @AMDEP_TRUE@@am__include@ @am__quote@ndn-cpp/security/identity/$(DEPDIR)/identity-manager.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@ndn-cpp/security/identity/$(DEPDIR)/memory-identity-storage.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@ndn-cpp/security/identity/$(DEPDIR)/memory-private-key-storage.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@ndn-cpp/security/policy/$(DEPDIR)/no-verify-policy-manager.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@ndn-cpp/transport/$(DEPDIR)/tcp-transport.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@ndn-cpp/transport/$(DEPDIR)/transport.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@ndn-cpp/transport/$(DEPDIR)/udp-transport.Plo@am__quote@
@@ -1055,6 +1070,7 @@
 	-rm -rf ndn-cpp/security/.libs ndn-cpp/security/_libs
 	-rm -rf ndn-cpp/security/certificate/.libs ndn-cpp/security/certificate/_libs
 	-rm -rf ndn-cpp/security/identity/.libs ndn-cpp/security/identity/_libs
+	-rm -rf ndn-cpp/security/policy/.libs ndn-cpp/security/policy/_libs
 	-rm -rf ndn-cpp/transport/.libs ndn-cpp/transport/_libs
 	-rm -rf ndn-cpp/util/.libs ndn-cpp/util/_libs
 
@@ -1336,6 +1352,8 @@
 	-rm -f ndn-cpp/security/certificate/$(am__dirstamp)
 	-rm -f ndn-cpp/security/identity/$(DEPDIR)/$(am__dirstamp)
 	-rm -f ndn-cpp/security/identity/$(am__dirstamp)
+	-rm -f ndn-cpp/security/policy/$(DEPDIR)/$(am__dirstamp)
+	-rm -f ndn-cpp/security/policy/$(am__dirstamp)
 	-rm -f ndn-cpp/transport/$(DEPDIR)/$(am__dirstamp)
 	-rm -f ndn-cpp/transport/$(am__dirstamp)
 	-rm -f ndn-cpp/util/$(DEPDIR)/$(am__dirstamp)
@@ -1353,7 +1371,7 @@
 
 distclean: distclean-am
 	-rm -f $(am__CONFIG_DISTCLEAN_FILES)
-	-rm -rf ndn-cpp/$(DEPDIR) ndn-cpp/c/$(DEPDIR) ndn-cpp/c/encoding/$(DEPDIR) ndn-cpp/c/transport/$(DEPDIR) ndn-cpp/c/util/$(DEPDIR) ndn-cpp/encoding/$(DEPDIR) ndn-cpp/security/$(DEPDIR) ndn-cpp/security/certificate/$(DEPDIR) ndn-cpp/security/identity/$(DEPDIR) ndn-cpp/transport/$(DEPDIR) ndn-cpp/util/$(DEPDIR) tests/$(DEPDIR)
+	-rm -rf ndn-cpp/$(DEPDIR) ndn-cpp/c/$(DEPDIR) ndn-cpp/c/encoding/$(DEPDIR) ndn-cpp/c/transport/$(DEPDIR) ndn-cpp/c/util/$(DEPDIR) ndn-cpp/encoding/$(DEPDIR) ndn-cpp/security/$(DEPDIR) ndn-cpp/security/certificate/$(DEPDIR) ndn-cpp/security/identity/$(DEPDIR) ndn-cpp/security/policy/$(DEPDIR) ndn-cpp/transport/$(DEPDIR) ndn-cpp/util/$(DEPDIR) tests/$(DEPDIR)
 	-rm -f Makefile
 distclean-am: clean-am distclean-compile distclean-generic \
 	distclean-hdr distclean-libtool distclean-tags
@@ -1401,7 +1419,7 @@
 maintainer-clean: maintainer-clean-am
 	-rm -f $(am__CONFIG_DISTCLEAN_FILES)
 	-rm -rf $(top_srcdir)/autom4te.cache
-	-rm -rf ndn-cpp/$(DEPDIR) ndn-cpp/c/$(DEPDIR) ndn-cpp/c/encoding/$(DEPDIR) ndn-cpp/c/transport/$(DEPDIR) ndn-cpp/c/util/$(DEPDIR) ndn-cpp/encoding/$(DEPDIR) ndn-cpp/security/$(DEPDIR) ndn-cpp/security/certificate/$(DEPDIR) ndn-cpp/security/identity/$(DEPDIR) ndn-cpp/transport/$(DEPDIR) ndn-cpp/util/$(DEPDIR) tests/$(DEPDIR)
+	-rm -rf ndn-cpp/$(DEPDIR) ndn-cpp/c/$(DEPDIR) ndn-cpp/c/encoding/$(DEPDIR) ndn-cpp/c/transport/$(DEPDIR) ndn-cpp/c/util/$(DEPDIR) ndn-cpp/encoding/$(DEPDIR) ndn-cpp/security/$(DEPDIR) ndn-cpp/security/certificate/$(DEPDIR) ndn-cpp/security/identity/$(DEPDIR) ndn-cpp/security/policy/$(DEPDIR) ndn-cpp/transport/$(DEPDIR) ndn-cpp/util/$(DEPDIR) tests/$(DEPDIR)
 	-rm -f Makefile
 maintainer-clean-am: distclean-am maintainer-clean-generic
 
diff --git a/ndn-cpp/security/policy/no-verify-policy-manager.cpp b/ndn-cpp/security/policy/no-verify-policy-manager.cpp
new file mode 100644
index 0000000..172845e
--- /dev/null
+++ b/ndn-cpp/security/policy/no-verify-policy-manager.cpp
@@ -0,0 +1,52 @@
+/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil -*- */
+/**
+ * Copyright (C) 2013 Regents of the University of California.
+ * @author: Yingdi Yu <yingdi@cs.ucla.edu>
+ * @author: Jeff Thompson <jefft0@remap.ucla.edu>
+ * See COPYING for copyright and distribution information.
+ */
+
+#include "no-verify-policy-manager.hpp"
+
+using namespace std;
+using namespace ndn::ptr_lib;
+
+namespace ndn {
+
+NoVerifyPolicyManager::~NoVerifyPolicyManager()
+{
+}
+
+bool 
+NoVerifyPolicyManager::skipVerifyAndTrust(const Data& data)
+{ 
+  return true; 
+}
+
+bool
+NoVerifyPolicyManager::requireVerify(const Data& data)
+{ 
+  return false; 
+}
+    
+shared_ptr<ValidationRequest>
+NoVerifyPolicyManager::checkVerificationPolicy
+  (const shared_ptr<Data>& data, const int& stepCount, const OnVerified& onVerified, const OnVerifyFailed& onVerifyFailed)
+{ 
+  onVerified(data); 
+  return shared_ptr<ValidationRequest>();
+}
+
+bool 
+NoVerifyPolicyManager::checkSigningPolicy(const Name& dataName, const Name& certificateName)
+{ 
+  return true; 
+}
+
+Name 
+NoVerifyPolicyManager::inferSigningIdentity(const Name& dataName)
+{ 
+  return Name(); 
+}
+
+}
diff --git a/ndn-cpp/security/policy/no-verify-policy-manager.hpp b/ndn-cpp/security/policy/no-verify-policy-manager.hpp
new file mode 100644
index 0000000..8b72eda
--- /dev/null
+++ b/ndn-cpp/security/policy/no-verify-policy-manager.hpp
@@ -0,0 +1,72 @@
+/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil -*- */
+/**
+ * Copyright (C) 2013 Regents of the University of California.
+ * @author: Yingdi Yu <yingdi@cs.ucla.edu>
+ * @author: Jeff Thompson <jefft0@remap.ucla.edu>
+ * See COPYING for copyright and distribution information.
+ */
+
+#ifndef NDN_NO_VERIFY_POLICY_MANAGER_HPP
+#define	NDN_NO_VERIFY_POLICY_MANAGER_HPP
+
+#include "policy-manager.hpp"
+
+namespace ndn {
+
+class NoVerifyPolicyManager : public PolicyManager {
+public:
+  /**
+   * The virtual destructor.
+   */
+  virtual
+  ~NoVerifyPolicyManager();
+
+  /**
+   * Override to always skip verification and trust as valid.
+   * @param data The received data packet.
+   * @return true.
+   */
+  virtual bool 
+  skipVerifyAndTrust(const Data& data);
+
+  /**
+   * Override to return false for no verification rule for the received data.
+   * @param data The received data packet.
+   * @return false.
+   */
+  virtual bool
+  requireVerify(const Data& data);
+
+  /**
+   * Override to call onVerified(data) and to indicate no further verification step.
+   * @param data The Data object with the signature to check.
+   * @param stepCount The number of verification steps that have been done, used to track the verification progress.
+   * @param onVerified This does override to call onVerified(data).
+   * @param onVerifyFailed Override to ignore this.
+   * @return null for no further step.
+   */
+  virtual ptr_lib::shared_ptr<ValidationRequest>
+  checkVerificationPolicy
+    (const ptr_lib::shared_ptr<Data>& data, const int& stepCount, const OnVerified& onVerified, const OnVerifyFailed& onVerifyFailed);
+    
+  /**
+   * Override to always indicate that the signing certificate name and data name satisfy the signing policy.
+   * @param dataName The name of data to be signed.
+   * @param certificateName The name of signing certificate.
+   * @return true to indicate that the signing certificate can be used to sign the data.
+   */
+  virtual bool 
+  checkSigningPolicy(const Name& dataName, const Name& certificateName);
+    
+  /**
+   * Override to indicate that the signing identity cannot be inferred.
+   * @param dataName The name of data to be signed.
+   * @return An empty name because cannot infer. 
+   */
+  virtual Name 
+  inferSigningIdentity(const Name& dataName);
+};
+
+}
+
+#endif
diff --git a/ndn-cpp/security/policy/policy-manager.hpp b/ndn-cpp/security/policy/policy-manager.hpp
new file mode 100644
index 0000000..458f84f
--- /dev/null
+++ b/ndn-cpp/security/policy/policy-manager.hpp
@@ -0,0 +1,79 @@
+/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil -*- */
+/**
+ * Copyright (C) 2013 Regents of the University of California.
+ * @author: Yingdi Yu <yingdi@cs.ucla.edu>
+ * @author: Jeff Thompson <jefft0@remap.ucla.edu>
+ * See COPYING for copyright and distribution information.
+ */
+
+#ifndef NDN_POLICY_MANAGER_HPP
+#define	NDN_POLICY_MANAGER_HPP
+
+#include "../../data.hpp"
+#include "../key-chain.hpp"
+
+namespace ndn {
+
+class ValidationRequest;
+  
+/**
+ * A PolicyManager is an abstract base class to represent the policy for verifying data packets.
+ * You must create an object of a subclass.
+ */
+class PolicyManager {
+public:
+  /**
+   * The virtual destructor.
+   */
+  virtual
+  ~PolicyManager() {}
+
+  /**
+   * Check if the received data packet can escape from verification and be trusted as valid.
+   * @param data The received data packet.
+   * @return true if the data does not need to be verified to be trusted as valid, otherwise false.
+   */
+  virtual bool 
+  skipVerifyAndTrust(const Data& data) = 0;
+
+  /**
+   * Check if this PolicyManager has a verification rule for the received data.
+   * @param data The received data packet.
+   * @return true if the data must be verified, otherwise false.
+   */
+  virtual bool
+  requireVerify(const Data& data) = 0;
+
+  /**
+   * Check whether the received data packet complies with the verification policy, and get the indication of the next verification step.
+   * @param data The Data object with the signature to check.
+   * @param stepCount The number of verification steps that have been done, used to track the verification progress.
+   * @param onVerified If the signature is verified, this calls onVerified(data).
+   * @param onVerifyFailed If the signature check fails, this calls onVerifyFailed(data).
+   * @return the indication of next verification step, null if there is no further step.
+   */
+  virtual ptr_lib::shared_ptr<ValidationRequest>
+  checkVerificationPolicy
+    (const ptr_lib::shared_ptr<Data>& data, const int& stepCount, const OnVerified& onVerified, const OnVerifyFailed& onVerifyFailed) = 0;
+    
+  /**
+   * Check if the signing certificate name and data name satisfy the signing policy.
+   * @param dataName The name of data to be signed.
+   * @param certificateName The name of signing certificate.
+   * @return true if the signing certificate can be used to sign the data, otherwise false.
+   */
+  virtual bool 
+  checkSigningPolicy(const Name& dataName, const Name& certificateName) = 0;
+    
+  /**
+   * Infer the signing identity name according to the policy. If the signing identity cannot be inferred, return an empty name.
+   * @param dataName The name of data to be signed.
+   * @return The signing identity or an empty name if cannot infer. 
+   */
+  virtual Name 
+  inferSigningIdentity(const Name& dataName) = 0;
+};
+
+}
+
+#endif