In PublisherPublicKeyDigest, make the value a Blob.
diff --git a/ndn-cpp/publisher-public-key-digest.hpp b/ndn-cpp/publisher-public-key-digest.hpp
index 0a5a2c5..4d02821 100644
--- a/ndn-cpp/publisher-public-key-digest.hpp
+++ b/ndn-cpp/publisher-public-key-digest.hpp
@@ -30,7 +30,7 @@
{
publisherPublicKeyDigestStruct.publisherPublicKeyDigestLength = publisherPublicKeyDigest_.size();
if (publisherPublicKeyDigest_.size() > 0)
- publisherPublicKeyDigestStruct.publisherPublicKeyDigest = (unsigned char *)&publisherPublicKeyDigest_[0];
+ publisherPublicKeyDigestStruct.publisherPublicKeyDigest = (unsigned char *)publisherPublicKeyDigest_.buf();
else
publisherPublicKeyDigestStruct.publisherPublicKeyDigest = 0;
}
@@ -41,17 +41,16 @@
*/
void set(const struct ndn_PublisherPublicKeyDigest& publisherPublicKeyDigestStruct)
{
- setVector(publisherPublicKeyDigest_, publisherPublicKeyDigestStruct.publisherPublicKeyDigest,
- publisherPublicKeyDigestStruct.publisherPublicKeyDigestLength);
+ publisherPublicKeyDigest_ =
+ Blob(publisherPublicKeyDigestStruct.publisherPublicKeyDigest, publisherPublicKeyDigestStruct.publisherPublicKeyDigestLength);
}
- const std::vector<unsigned char>& getPublisherPublicKeyDigest() const { return publisherPublicKeyDigest_; }
- std::vector<unsigned char>& getPublisherPublicKeyDigest() { return publisherPublicKeyDigest_; }
+ const Blob& getPublisherPublicKeyDigest() const { return publisherPublicKeyDigest_; }
void setPublisherPublicKeyDigest(const std::vector<unsigned char>& publisherPublicKeyDigest) { publisherPublicKeyDigest_ = publisherPublicKeyDigest; }
void setPublisherPublicKeyDigest(const unsigned char *publisherPublicKeyDigest, unsigned int publisherPublicKeyDigestLength)
{
- setVector(publisherPublicKeyDigest_, publisherPublicKeyDigest, publisherPublicKeyDigestLength);
+ publisherPublicKeyDigest_ = Blob(publisherPublicKeyDigest, publisherPublicKeyDigestLength);
}
/**
@@ -59,11 +58,11 @@
*/
void clear()
{
- publisherPublicKeyDigest_.clear();
+ publisherPublicKeyDigest_.reset();
}
private:
- std::vector<unsigned char> publisherPublicKeyDigest_;
+ Blob publisherPublicKeyDigest_;
};
}