blob: e927a8ea7b0df1f9e1df9dbc551a04ea7e072a8b [file] [log] [blame]
Jeff Thompson5cae5e52013-07-10 19:41:20 -07001/**
2 * @author: Jeff Thompson
3 * See COPYING for copyright and distribution information.
4 */
5
6#include "common.hpp"
Jeff Thompson53412192013-08-06 13:35:50 -07007#include "key.hpp"
Jeff Thompson5cae5e52013-07-10 19:41:20 -07008
9using namespace std;
10
11namespace ndn {
12
13void KeyLocator::get(struct ndn_KeyLocator &keyLocatorStruct) const
14{
15 keyLocatorStruct.type = type_;
16
Jeff Thompson63d02692013-08-16 12:09:07 -070017 keyLocatorStruct.keyDataLength = keyData_.size();
18 if (keyData_.size() > 0)
19 keyLocatorStruct.keyData = (unsigned char *)&keyData_[0];
Jeff Thompson5cae5e52013-07-10 19:41:20 -070020 else
Jeff Thompson63d02692013-08-16 12:09:07 -070021 keyLocatorStruct.keyData = 0;
Jeff Thompson5cae5e52013-07-10 19:41:20 -070022
23 // TODO: Implement keyName.
24}
25
26void KeyLocator::set(const struct ndn_KeyLocator &keyLocatorStruct)
27{
28 type_ = keyLocatorStruct.type;
Jeff Thompson63d02692013-08-16 12:09:07 -070029 setVector(keyData_, keyLocatorStruct.keyData, keyLocatorStruct.keyDataLength);
Jeff Thompson5cae5e52013-07-10 19:41:20 -070030 // TODO: Implement keyName.
31}
32
33}
34