blob: cfaa0d59e2eb4dac364d701a2da17449167fe956 [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,
akmhoque2fafaa52013-03-22 05:10:52 -050028 char *router_name,
29 long int freshness);
akmhoque7c64d802013-03-05 10:18:37 -060030
31int contain_key_name(const unsigned char *ccnb,
32 struct ccn_parsed_ContentObject *pco);
33struct ccn_charbuf * get_key_name(const unsigned char *ccnb,
34 struct ccn_parsed_ContentObject *pco);
35
akmhoque6e2ba842013-03-05 19:35:26 -060036int verify_key(const unsigned char *ccnb,
akmhoqueb7958182013-03-11 12:03:54 -050037 struct ccn_parsed_ContentObject *pco,
38 int content_type);
akmhoque7c64d802013-03-05 10:18:37 -060039
akmhoque237239c2013-03-18 10:29:26 -050040void add_key(char *keyname);
41int does_key_exist(char *keyname);
42
43void destroy_keys(void);
44
akmhoque7c64d802013-03-05 10:18:37 -060045#endif