security: CryptoPP functions are used directly to encode/decode DER/BER

This change eliminates the need for custom der decoder/encoder.

Change-Id: I5be2e55cec2b63157927a4ad87fffe8e8651ed3c
diff --git a/src/encoding/cryptopp/asn_ext.hpp b/src/encoding/cryptopp/asn_ext.hpp
new file mode 100644
index 0000000..a7be874
--- /dev/null
+++ b/src/encoding/cryptopp/asn_ext.hpp
@@ -0,0 +1,30 @@
+/**
+ * Copyright (C) 2013 Regents of the University of California.
+ * @author: Jeff Thompson <jefft0@remap.ucla.edu>
+ * @author: Yingdi Yu <yingdi@cs.ucla.edu>
+ * @author: Alexander Afanasyev <alexander.afanasyev@ucla.edu>
+ * See COPYING for copyright and distribution information.
+ */
+
+#ifndef NDN_ASN_EXT_HPP
+#define NDN_ASN_EXT_HPP
+
+#include <ndn-cpp/common.hpp>
+#include <cryptopp/asn.h>
+
+namespace ndn {
+
+namespace Asn {
+struct Error : public std::runtime_error { Error(const std::string &what) : std::runtime_error(what) {} };
+}
+
+size_t
+DEREncodeGeneralTime(CryptoPP::BufferedTransformation &bt, MillisecondsSince1970 time);
+
+void
+BERDecodeTime(CryptoPP::BufferedTransformation &bt, MillisecondsSince1970 &time);
+
+} // namespace ndn
+
+#endif // NDN_ASN_EXT_HPP
+