Jeff Thompson | 5cae5e5 | 2013-07-10 19:41:20 -0700 | [diff] [blame] | 1 | /** |
| 2 | * @author: Jeff Thompson |
| 3 | * See COPYING for copyright and distribution information. |
| 4 | */ |
| 5 | |
| 6 | #include "common.hpp" |
Jeff Thompson | 5341219 | 2013-08-06 13:35:50 -0700 | [diff] [blame] | 7 | #include "key.hpp" |
Jeff Thompson | 5cae5e5 | 2013-07-10 19:41:20 -0700 | [diff] [blame] | 8 | |
| 9 | using namespace std; |
| 10 | |
| 11 | namespace ndn { |
| 12 | |
| 13 | void KeyLocator::get(struct ndn_KeyLocator &keyLocatorStruct) const |
| 14 | { |
| 15 | keyLocatorStruct.type = type_; |
| 16 | |
Jeff Thompson | 63d0269 | 2013-08-16 12:09:07 -0700 | [diff] [blame^] | 17 | keyLocatorStruct.keyDataLength = keyData_.size(); |
| 18 | if (keyData_.size() > 0) |
| 19 | keyLocatorStruct.keyData = (unsigned char *)&keyData_[0]; |
Jeff Thompson | 5cae5e5 | 2013-07-10 19:41:20 -0700 | [diff] [blame] | 20 | else |
Jeff Thompson | 63d0269 | 2013-08-16 12:09:07 -0700 | [diff] [blame^] | 21 | keyLocatorStruct.keyData = 0; |
Jeff Thompson | 5cae5e5 | 2013-07-10 19:41:20 -0700 | [diff] [blame] | 22 | |
| 23 | // TODO: Implement keyName. |
| 24 | } |
| 25 | |
| 26 | void KeyLocator::set(const struct ndn_KeyLocator &keyLocatorStruct) |
| 27 | { |
| 28 | type_ = keyLocatorStruct.type; |
Jeff Thompson | 63d0269 | 2013-08-16 12:09:07 -0700 | [diff] [blame^] | 29 | setVector(keyData_, keyLocatorStruct.keyData, keyLocatorStruct.keyDataLength); |
Jeff Thompson | 5cae5e5 | 2013-07-10 19:41:20 -0700 | [diff] [blame] | 30 | // TODO: Implement keyName. |
| 31 | } |
| 32 | |
| 33 | } |
| 34 | |