2
* $Id: make_key.c,v 1.3 2003/10/20 20:49:15 andrew_belov Exp $
3
* ---------------------------------------------------------------------------
4
* This is a key generation utility.
12
DEBUGHDR(__FILE__) /* Debug information block */
16
int main(int argc, char **argv)
20
unsigned long validation[8];
22
printf("MAKE_KEY v 1.13 [16/12/2000] Not a part of any binary package!\n\n");
25
printf("Usage: MAKE_KEY \"<username>\" <license code> <product ID> <filename>\n"
26
"Where: <username> is the quoted \"<name> [<license>] [<ARJ key>|<SDN key>]\n"
27
" <name> is a free-form string\n"
28
" <license> is \"(EXT LIC)\" if extended license\n"
29
" <ARJ key> is \"R#nnnn\", zero-padded\n"
30
" <SDN key> is \"SDN#0xnnnn\", where x is:\n"
31
" 1 is for SDN-originated packages\n"
32
" 2 is for SDN-distributed packages\n"
33
" <license code> is the license code (e.g., ARJR#1)\n"
34
" ARJR#1 is a private license\n"
35
" ARJR#2 is a public license\n"
36
" <product ID> is a product version number: <series><version>\n"
37
" <series> is product series (\"A\" for ARJ)\n"
38
" <version> is product version (\"3\" for v 3.x)\n"
39
" <filename> is the name of file which accepts the registration data\n"
41
"Example: MAKE_KEY \"John Doe (EXT LIC) R#0843\" ARJR#2 A2 arj.key\n");
44
printf("Initializing...\n");
46
printf("Creating key signature...\n");
47
create_reg_key(argv[2], argv[3], argv[1], (char *)validation);
48
rc=verify_reg_name(argv[2], argv[3], argv[1], (char *)validation);
49
printf("Verifying key... RC = %d\n", rc);
52
if((stream=fopen(argv[4], "w"))!=NULL)
55
fprintf(stream, "%10lu ", validation[i]);
56
fprintf(stream, "%s %s %s", argv[2], argv[3], argv[1]);
59
printf("ARJ-SECURITY calculation completed.\n");
64
printf("Key creation error!\n");