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 | |
| 17 | keyLocatorStruct.keyOrCertificateLength = keyOrCertificate_.size(); |
| 18 | if (keyOrCertificate_.size() > 0) |
| 19 | keyLocatorStruct.keyOrCertificate = (unsigned char *)&keyOrCertificate_[0]; |
| 20 | else |
| 21 | keyLocatorStruct.keyOrCertificate = 0; |
| 22 | |
| 23 | // TODO: Implement keyName. |
| 24 | } |
| 25 | |
| 26 | void KeyLocator::set(const struct ndn_KeyLocator &keyLocatorStruct) |
| 27 | { |
| 28 | type_ = keyLocatorStruct.type; |
| 29 | setVector(keyOrCertificate_, keyLocatorStruct.keyOrCertificate, keyLocatorStruct.keyOrCertificateLength); |
| 30 | // TODO: Implement keyName. |
| 31 | } |
| 32 | |
| 33 | } |
| 34 | |