char *FMT_make_id(char *addr, char *subject, params_t params) { char *year = FMT_get_year(); int i; char *s; if (!addr) { return NULL; } //XXX: yet another magic number i = strlen(addr) + strlen(IBE_system(params)) + 1000; if (subject) i += strlen(subject); s = (char *) malloc(i); i = sprintf(s, "purpose=email&date=%s&id=%s&", year, addr); if (subject) { i += sprintf(&s[i], "subject=%s&", subject); } sprintf(&s[i], "system=%s", IBE_system(params)); free(year); return s; }
int certify(int argc, char **argv) { char *id; char *public; int count = IBE_threshold(params); char **sfiles; int i; byte_string_t master; byte_string_t pub; byte_string_t cert; if (argc < 2) { printf("Usage: certify ID SHAREFILES\n\n"); printf("Creates a certificate for the ID, signed by share\n"); return 1; } id = IBE_system(params); public = argv[1];