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 | #ifndef NDN_KEY_H |
| 7 | #define NDN_KEY_H |
| 8 | |
| 9 | #ifdef __cplusplus |
| 10 | extern "C" { |
| 11 | #endif |
| 12 | |
| 13 | typedef enum { |
| 14 | ndn_KeyLocatorType_KEY = 1, |
| 15 | ndn_KeyLocatorType_CERTIFICATE = 2, |
| 16 | ndn_KeyLocatorType_KEYNAME = 3 |
| 17 | } ndn_KeyLocatorType; |
| 18 | |
| 19 | struct 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 | |
| 27 | static 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 |