Internal: Use C struct ndn_Blob where possible. Make ndn::Blob work with ndn_Blob.
diff --git a/ndn-cpp/key.cpp b/ndn-cpp/key.cpp
index ef57265..db3ea58 100644
--- a/ndn-cpp/key.cpp
+++ b/ndn-cpp/key.cpp
@@ -15,13 +15,7 @@
KeyLocator::get(struct ndn_KeyLocator& keyLocatorStruct) const
{
keyLocatorStruct.type = type_;
-
- keyLocatorStruct.keyDataLength = keyData_.size();
- if (keyData_.size() > 0)
- keyLocatorStruct.keyData = (uint8_t *)keyData_.buf();
- else
- keyLocatorStruct.keyData = 0;
-
+ keyData_.get(keyLocatorStruct.keyData);
keyName_.get(keyLocatorStruct.keyName);
keyLocatorStruct.keyNameType = keyNameType_;
}
@@ -30,7 +24,7 @@
KeyLocator::set(const struct ndn_KeyLocator& keyLocatorStruct)
{
type_ = keyLocatorStruct.type;
- keyData_ = Blob(keyLocatorStruct.keyData, keyLocatorStruct.keyDataLength);
+ keyData_ = Blob(keyLocatorStruct.keyData);
if (keyLocatorStruct.type == ndn_KeyLocatorType_KEYNAME) {
keyName_.set(keyLocatorStruct.keyName);
keyNameType_ = keyLocatorStruct.keyNameType;