blob: 65c2dcaa3714b09e023b1adc92820aab00752120 [file] [log] [blame]
akmhoque7c64d802013-03-05 10:18:37 -06001#ifndef _NLSR_KM_H_
2#define _NLSR_KM_H_
3
4enum 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
akmhoque237239c2013-03-18 10:29:26 -050014struct nlsr_key{
15 char *key_name;
16};
akmhoque7c64d802013-03-05 10:18:37 -060017
18
19int
20sign_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,
28 char *router_name);
29
30int contain_key_name(const unsigned char *ccnb,
31 struct ccn_parsed_ContentObject *pco);
32struct ccn_charbuf * get_key_name(const unsigned char *ccnb,
33 struct ccn_parsed_ContentObject *pco);
34
akmhoque6e2ba842013-03-05 19:35:26 -060035int verify_key(const unsigned char *ccnb,
akmhoqueb7958182013-03-11 12:03:54 -050036 struct ccn_parsed_ContentObject *pco,
37 int content_type);
akmhoque7c64d802013-03-05 10:18:37 -060038
akmhoque237239c2013-03-18 10:29:26 -050039void add_key(char *keyname);
40int does_key_exist(char *keyname);
41
42void destroy_keys(void);
43
akmhoque7c64d802013-03-05 10:18:37 -060044#endif