blob: 45425f2b6fb22db370adbc8eb6a8e2f36be99bdf [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"
7#include "Key.hpp"
8
9using namespace std;
10
11namespace ndn {
12
13void 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
26void 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