akmhoque | 7c64d80 | 2013-03-05 10:18:37 -0600 | [diff] [blame] | 1 | #ifndef _NLSR_KM_H_ |
| 2 | #define _NLSR_KM_H_ |
| 3 | |
| 4 | enum key_type{ |
| 5 | ROOT_KEY, //0 |
| 6 | SITE_KEY, //1 |
| 7 | OPERATOR_KEY,//2 |
| 8 | ROUTING_KEY,//3 |
| 9 | NLSR_KEY,//4 |
| 10 | UNKNOWN_KEY//5 |
| 11 | }; |
| 12 | |
| 13 | |
akmhoque | 237239c | 2013-03-18 10:29:26 -0500 | [diff] [blame] | 14 | struct nlsr_key{ |
| 15 | char *key_name; |
| 16 | }; |
akmhoque | 7c64d80 | 2013-03-05 10:18:37 -0600 | [diff] [blame] | 17 | |
| 18 | |
| 19 | int |
| 20 | sign_content_with_user_defined_keystore(struct ccn_charbuf *content_name, |
| 21 | struct ccn_charbuf *resultbuf, |
| 22 | const void *data, |
| 23 | size_t data_size, |
| 24 | char *keystore_path, |
| 25 | char *keystore_passphrase, |
| 26 | char *key_repo_name, |
| 27 | char *site_name, |
akmhoque | 2fafaa5 | 2013-03-22 05:10:52 -0500 | [diff] [blame] | 28 | char *router_name, |
| 29 | long int freshness); |
akmhoque | 7c64d80 | 2013-03-05 10:18:37 -0600 | [diff] [blame] | 30 | |
| 31 | int contain_key_name(const unsigned char *ccnb, |
| 32 | struct ccn_parsed_ContentObject *pco); |
| 33 | struct ccn_charbuf * get_key_name(const unsigned char *ccnb, |
| 34 | struct ccn_parsed_ContentObject *pco); |
| 35 | |
akmhoque | 6e2ba84 | 2013-03-05 19:35:26 -0600 | [diff] [blame] | 36 | int verify_key(const unsigned char *ccnb, |
akmhoque | b795818 | 2013-03-11 12:03:54 -0500 | [diff] [blame] | 37 | struct ccn_parsed_ContentObject *pco, |
| 38 | int content_type); |
akmhoque | 7c64d80 | 2013-03-05 10:18:37 -0600 | [diff] [blame] | 39 | |
akmhoque | 237239c | 2013-03-18 10:29:26 -0500 | [diff] [blame] | 40 | void add_key(char *keyname); |
| 41 | int does_key_exist(char *keyname); |
| 42 | |
| 43 | void destroy_keys(void); |
| 44 | |
akmhoque | 7c64d80 | 2013-03-05 10:18:37 -0600 | [diff] [blame] | 45 | #endif |