PublisherPublicKeyDigest: in setPublisherPublicKeyDigest, just support const Blob& since the Blob constructor makes the necessary conversions.
diff --git a/include/ndn-cpp/publisher-public-key-digest.hpp b/include/ndn-cpp/publisher-public-key-digest.hpp
index ad60ef4..289e682 100644
--- a/include/ndn-cpp/publisher-public-key-digest.hpp
+++ b/include/ndn-cpp/publisher-public-key-digest.hpp
@@ -44,33 +44,7 @@
getPublisherPublicKeyDigest() const { return publisherPublicKeyDigest_; }
void
- setPublisherPublicKeyDigest(const std::vector<uint8_t>& publisherPublicKeyDigest)
- {
- publisherPublicKeyDigest_ = publisherPublicKeyDigest;
- }
-
- void
- setPublisherPublicKeyDigest(const uint8_t *publisherPublicKeyDigest, size_t publisherPublicKeyDigestLength)
- {
- publisherPublicKeyDigest_ = Blob(publisherPublicKeyDigest, publisherPublicKeyDigestLength);
- }
-
- /**
- * Set the publisher public key digest to point to an existing byte array. IMPORTANT: After calling this,
- * if you keep a pointer to the array then you must treat the array as immutable and promise not to change it.
- * @param signature A pointer to a vector with the byte array. This takes another reference and does not copy the bytes.
- */
- void
- setPublisherPublicKeyDigest(const ptr_lib::shared_ptr<std::vector<uint8_t> > &publisherPublicKeyDigest)
- {
- publisherPublicKeyDigest_ = publisherPublicKeyDigest;
- }
-
- void
- setPublisherPublicKeyDigest(const ptr_lib::shared_ptr<const std::vector<uint8_t> > &publisherPublicKeyDigest)
- {
- publisherPublicKeyDigest_ = publisherPublicKeyDigest;
- }
+ setPublisherPublicKeyDigest(const Blob& publisherPublicKeyDigest) { publisherPublicKeyDigest_ = publisherPublicKeyDigest; }
/**
* Clear the publisherPublicKeyDigest.
diff --git a/src/node.cpp b/src/node.cpp
index a31144c..7ad328c 100644
--- a/src/node.cpp
+++ b/src/node.cpp
@@ -87,9 +87,9 @@
// Set the public key.
uint8_t publicKeyDigest[SHA256_DIGEST_LENGTH];
ndn_digestSha256(SELFREG_PUBLIC_KEY_DER, sizeof(SELFREG_PUBLIC_KEY_DER), publicKeyDigest);
- signature->getPublisherPublicKeyDigest().setPublisherPublicKeyDigest(publicKeyDigest, sizeof(publicKeyDigest));
+ signature->getPublisherPublicKeyDigest().setPublisherPublicKeyDigest(Blob(publicKeyDigest, sizeof(publicKeyDigest)));
signature->getKeyLocator().setType(ndn_KeyLocatorType_KEY);
- signature->getKeyLocator().setKeyData(SELFREG_PUBLIC_KEY_DER, sizeof(SELFREG_PUBLIC_KEY_DER));
+ signature->getKeyLocator().setKeyData(Blob(SELFREG_PUBLIC_KEY_DER, sizeof(SELFREG_PUBLIC_KEY_DER)));
// Sign the fields.
SignedBlob encoding = data.wireEncode(wireFormat);