Ticket #1019: patch.diff

File patch.diff, 1.8 KB (added by teleyinex, 14 years ago)

Patch for improving the output of crypt_prog.

  • crypt_prog.cpp

     
    110110    bool kpriv=false; // private key ?
    111111
    112112    if (argc == 1) {
    113         printf("missing command\n");
     113        printf("missing command\nTry `crypt_prog -help' for more information.\n");
    114114        exit(1);
    115115    }
     116
     117    if (!strcmp(argv[1], "-help")){
     118        printf("Utility program for encryption.\n"
     119                 "-genkey n private_keyfile public_keyfile\n"
     120                                  "\tcreate a key pair with n bits (512 <= n <= 1024)\n"
     121                                  "\twrite it in hex notation\n"
     122                 "-sign file private_keyfile\n"
     123                                  "\tcreate a signature for a given file\n"
     124                                  "\twrite it in hex notation\n"
     125                 "-sign_string string private_keyfile\n"
     126                                  "\tcreate a signature for a given string\n"
     127                                  "\twrite it in hex notation\n"
     128                 "-verify file signature_file public_keyfile\n"
     129                                  "\tverify a signature\n"
     130                 "-test_crypt private_keyfile public_keyfile\n"
     131                                  "\ttest encrypt/decrypt\n"
     132                 "-convkey o2b/b2o priv/pub input_file output_file\n"
     133                                  "\tconvert keys between BOINC and OpenSSL format\n"
     134                 "-cert_verify file signature_file certificate_dir\n"
     135                                  "\tverify a signature using a directory of certificates\n");
     136        exit(1);
     137   
     138    }
     139   
    116140    if (!strcmp(argv[1], "-genkey")) {
    117141        if (argc < 5) {
    118142            fprintf(stderr, "missing cmdline args\n");