diff --git a/ndn-cpp/util/signed-blob.hpp b/ndn-cpp/util/signed-blob.hpp
new file mode 100644
index 0000000..86b3da0
--- /dev/null
+++ b/ndn-cpp/util/signed-blob.hpp
@@ -0,0 +1,108 @@
+/**
+ * Copyright (C) 2013 Regents of the University of California.
+ * @author: Zhenkai Zhu <zhenkai@cs.ucla.edu>
+ * @author: Alexander Afanasyev <alexander.afanasyev@ucla.edu>
+ * @author: Jeff Thompson <jefft0@remap.ucla.edu>
+ * See COPYING for copyright and distribution information.
+ */
+
+#ifndef NDN_SIGNED_BLOB_HPP
+#define	NDN_SIGNED_BLOB_HPP
+
+#include "blob.hpp"
+
+namespace ndn {
+
+/**
+ * A SignedBlob extends Blob to keep the offsets of a signed portion (e.g., the bytes of Data packet).
+ */
+class SignedBlob : public Blob {
+public:
+  /**
+   * Create a new SignedBlob with an immutable copy of the given array.
+   * @param value A pointer to the byte array which is copied.
+   * @param valueLength The length of value.
+   * @param signedPortionBeginOffset The offset in the encoding of the beginning of the signed portion.
+   * @param signedPortionEndOffset The offset in the encoding of the end of the signed portion.
+   */
+  SignedBlob
+    (const unsigned char* value, unsigned int valueLength, unsigned int signedPortionBeginOffset, unsigned int signedPortionEndOffset)
+  : Blob(value, valueLength), signedPortionBeginOffset_(signedPortionBeginOffset), signedPortionEndOffset_(signedPortionEndOffset)
+  {
+  }
+  
+  /**
+   * Create a new SignedBlob with an immutable copy of the array in the given vector.
+   * If you want to transfer the array without copying, the the vector has to start as a 
+   * ptr_lib::shared_ptr<std::vector<unsigned char> > and you can use the SignedBlob constructor with this type.
+   * @param value A reference to a vector which is copied.
+   * @param signedPortionBeginOffset The offset in the encoding of the beginning of the signed portion.
+   * @param signedPortionEndOffset The offset in the encoding of the end of the signed portion.
+   */
+  SignedBlob
+    (const std::vector<unsigned char> &value, unsigned int signedPortionBeginOffset, unsigned int signedPortionEndOffset)
+  : Blob(value), signedPortionBeginOffset_(signedPortionBeginOffset), signedPortionEndOffset_(signedPortionEndOffset)
+  {
+  }
+  
+  /**
+   * Create a new SignedBlob to point to an existing byte array.  IMPORTANT: After calling this constructor,
+   * if you keep a pointer to the array then you must treat the array as immutable and promise not to change it.
+   * @param value A pointer to a vector with the byte array.  This takes another reference and does not copy the bytes.
+   * @param signedPortionBeginOffset The offset in the array of the beginning of the signed portion.
+   * @param signedPortionEndOffset The offset in the array of the end of the signed portion.
+   */
+  SignedBlob
+    (const ptr_lib::shared_ptr<std::vector<unsigned char> > &value, 
+     unsigned int signedPortionBeginOffset, unsigned int signedPortionEndOffset)
+  : Blob(value), signedPortionBeginOffset_(signedPortionBeginOffset), signedPortionEndOffset_(signedPortionEndOffset)
+  {
+  }
+  SignedBlob
+    (const ptr_lib::shared_ptr<const std::vector<unsigned char> > &value, 
+     unsigned int signedPortionBeginOffset, unsigned int signedPortionEndOffset)
+  : Blob(value), signedPortionBeginOffset_(signedPortionBeginOffset), signedPortionEndOffset_(signedPortionEndOffset)
+  {
+  }
+    
+  /**
+   * Return the length of the signed portion of the immutable byte array, or 0 of the pointer to the array is null.
+   */
+  unsigned int signedSize() const
+  {
+    if (*this)
+      return signedPortionEndOffset_ - signedPortionBeginOffset_;
+    else
+      return 0;
+  }
+
+  /**
+   * Return a const pointer to the first byte of the signed portion of the immutable byte array, or 0 if the 
+   * pointer to the array is null.
+   */
+  const unsigned char* signedBuf() const
+  {
+    if (*this)
+      return &(*this)->front() + signedPortionBeginOffset_;
+    else
+      return 0;
+  }
+
+  /**
+   * Return the offset in the array of the beginning of the signed portion.
+   */  
+  unsigned int getSignedPortionBeginOffset() { return signedPortionBeginOffset_; }
+
+  /**
+   * Return the offset in the array of the end of the signed portion.
+   */  
+  unsigned int getSignedPortionEndOffset() { return signedPortionEndOffset_; }
+  
+private:
+  unsigned int signedPortionBeginOffset_;
+  unsigned int signedPortionEndOffset_;
+};
+
+}
+
+#endif
