In KeyLocator, added support for KeyName.
diff --git a/ndn-cpp/key.cpp b/ndn-cpp/key.cpp
index e927a8e..7548968 100644
--- a/ndn-cpp/key.cpp
+++ b/ndn-cpp/key.cpp
@@ -20,14 +20,22 @@
else
keyLocatorStruct.keyData = 0;
- // TODO: Implement keyName.
+ keyName_.get(keyLocatorStruct.keyName);
+ keyLocatorStruct.keyNameType = keyNameType_;
}
void KeyLocator::set(const struct ndn_KeyLocator &keyLocatorStruct)
{
type_ = keyLocatorStruct.type;
setVector(keyData_, keyLocatorStruct.keyData, keyLocatorStruct.keyDataLength);
- // TODO: Implement keyName.
+ if (keyLocatorStruct.type == ndn_KeyLocatorType_KEYNAME) {
+ keyName_.set(keyLocatorStruct.keyName);
+ keyNameType_ = keyLocatorStruct.keyNameType;
+ }
+ else {
+ keyName_.clear();
+ keyNameType_ = (ndn_KeyNameType)-1;
+ }
}
}