blob: 1545a74b16f6eade78adba32766146b64888bd23 [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#ifndef NDN_KEY_H
7#define NDN_KEY_H
8
9#ifdef __cplusplus
10extern "C" {
11#endif
12
13typedef enum {
14 ndn_KeyLocatorType_KEY = 1,
15 ndn_KeyLocatorType_CERTIFICATE = 2,
16 ndn_KeyLocatorType_KEYNAME = 3
17} ndn_KeyLocatorType;
18
19struct ndn_KeyLocator {
20 ndn_KeyLocatorType type;
21 unsigned char *keyOrCertificate; /**< if type is ndn_KeyLocatorType_KEY, pointer to the pre-allocated buffer for the key value.
22 if type is ndn_KeyLocatorType_CERTIFICATE, pointer to the pre-allocated buffer for the cetrificate value. */
23 unsigned int keyOrCertificateLength;
24 // TODO: Implement keyName.
25};
26
27static inline void ndn_KeyLocator_init(struct ndn_KeyLocator *self) {
28 self->type = (ndn_KeyLocatorType)-1;
29 self->keyOrCertificate = 0;
30 self->keyOrCertificateLength = 0;
31 // TODO: Implement keyName.
32}
33
34#ifdef __cplusplus
35}
36#endif
37
38#endif