DER encoding: Added CertificateDataVisitor and use in Certificate::decode.
diff --git a/ndn-cpp/encoding/der/visitor/public-key-visitor.cpp b/ndn-cpp/encoding/der/visitor/public-key-visitor.cpp
new file mode 100644
index 0000000..87e4e6c
--- /dev/null
+++ b/ndn-cpp/encoding/der/visitor/public-key-visitor.cpp
@@ -0,0 +1,35 @@
+/* -*- 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 "simple-visitor.hpp"
+#include <ndn-cpp/security/certificate/public-key.hpp>
+#include "../der.hpp"
+#include "public-key-visitor.hpp"
+
+using namespace std;
+using namespace ndn::ptr_lib;
+
+namespace ndn {
+
+namespace der {
+
+ndnboost::any
+PublicKeyVisitor::visit(DerSequence& derSeq)
+{
+ const DerNodePtrList& children = derSeq.getChildren();
+
+ SimpleVisitor simpleVisitor;
+ shared_ptr<DerSequence> algoSeq = dynamic_pointer_cast<DerSequence>(children[0]);
+ OID algorithm = ndnboost::any_cast<OID>(algoSeq->getChildren()[0]->accept(simpleVisitor));
+ Blob raw = derSeq.getRaw();
+ return ndnboost::any(shared_ptr<PublicKey>(new PublicKey(algorithm, raw)));
+}
+
+} // der
+
+}