avoid using C99 constructs.
[gnutls.git] / src / certtool.gaa
bloba066bdf9e68cbb9e4ddcfc74556f08b0aa39a056
1 #{
3 /* C declarations */
5 #include <config.h>
6 #ifdef _WIN32
7 # include <io.h>
8 #endif
10 #include "certtool-common.h"
14 helpnode "Certtool help\nUsage: certtool [options]"
16 #int privkey_op;
17 #int action;
18 option (s, generate-self-signed) { $action=ACTION_SELF_SIGNED; } "Generate a self-signed certificate."
20 option (c, generate-certificate) { $action=ACTION_GENERATE_CERTIFICATE; } "Generate a signed certificate."
22 option (generate-proxy) { $action=ACTION_GENERATE_PROXY; } "Generate a proxy certificate."
24 option (generate-crl) { $action=ACTION_GENERATE_CRL; } "Generate a CRL."
26 option (u, update-certificate) { $action=ACTION_UPDATE_CERTIFICATE; } "Update a signed certificate."
28 option (p, generate-privkey) { $privkey_op=1; $action=ACTION_GENERATE_PRIVKEY; } "Generate a private key."
30 option (q, generate-request) { $privkey_op=1; $action=ACTION_GENERATE_REQUEST; } "Generate a PKCS #10 certificate request."
32 option (e, verify-chain) { $action=ACTION_VERIFY_CHAIN; } "Verify a PEM encoded certificate chain. The last certificate in the chain must be a self signed one."
34 option (verify-crl) { $action=ACTION_VERIFY_CRL; } "Verify a CRL."
36 option (generate-dh-params) { $action=ACTION_GENERATE_DH; } "Generate PKCS #3 encoded Diffie-Hellman parameters."
37 option (get-dh-params) { $action=ACTION_GET_DH; } "Get the included PKCS #3 encoded Diffie-Hellman parameters."
39 #char *privkey;
40 option (load-privkey) STR "FILE" { $privkey = $1 } "Private key file to use."
42 #char *pubkey;
43 option (load-pubkey) STR "FILE" { $pubkey = $1 } "Public key file to use."
45 #char *request;
46 option (load-request) STR "FILE" { $request = $1 } "Certificate request file to use."
48 #char *cert;
49 option (load-certificate) STR "FILE" { $cert = $1 } "Certificate file to use."
51 #char *ca_privkey;
52 option (load-ca-privkey) STR "FILE" { $ca_privkey = $1 } "Certificate authority's private key file to use."
54 #char *ca;
55 option (load-ca-certificate) STR "FILE" { $ca = $1 } "Certificate authority's certificate file to use."
57 #char *pass;
58 option (password) STR "PASSWORD" { $pass = $1 } "Password to use."
60 option (i, certificate-info) { $action = ACTION_CERT_INFO; } "Print information on a certificate."
62 option (certificate-pubkey) { $action = ACTION_CERT_PUBKEY; } "Print certificate public key."
64 option (pgp-certificate-info) { $action = ACTION_PGP_INFO; } "Print information on a OpenPGP certificate."
66 option (pgp-ring-info) { $action = ACTION_RING_INFO; } "Print information on a keyring structure."
68 option (l, crl-info) { $action = ACTION_CRL_INFO; } "Print information on a CRL."
70 option (crq-info) { $action = ACTION_REQUEST; } "Print information on a Certificate Request."
72 #int crq_extensions;
73 option (no-crq-extensions) { $crq_extensions = 0; } "Do not use extensions in certificate requests."
75 option (p12-info) { $action = ACTION_PKCS12_INFO; } "Print information on a PKCS #12 structure."
77 option (p7-info) { $action = ACTION_P7_INFO; } "Print information on a PKCS #7 structure."
79 option (smime-to-p7) { $action = ACTION_SMIME_TO_P7; } "Convert S/MIME to PKCS #7 structure."
81 /* on private key operations set $privkey_op to != 0 
82  */
83 option (k, key-info) { $privkey_op=1; $action = ACTION_PRIVKEY_INFO; } "Print information on a private key."
85 option (pgp-key-info) { $privkey_op=1; $action = ACTION_PGP_PRIVKEY_INFO; } "Print information on a OpenPGP private key."
87 option (pubkey-info) { $action = ACTION_PUBKEY_INFO; } "Print information on a public key."
89 #int fix_key;
90 option (fix-key) { $privkey_op=1; $fix_key = 1; } "Regenerate the parameters in a private key."
92 #int v1_cert;
93 option (v1) { $v1_cert = 1; } "Generate an X.509 version 1 certificate (no extensions)."
95 option (to-p12) { $action = ACTION_TO_PKCS12; } "Generate a PKCS #12 structure."
97 option (to-p8) { $action = ACTION_GENERATE_PKCS8; } "Generate a PKCS #8 key structure."
99 #int pkcs8;
100 option (8, pkcs8) { $pkcs8=1 } "Use PKCS #8 format for private keys."
102 #int dsa;
103 option (dsa) { $dsa=1 } "Use DSA keys."
105 #char *hash;
106 option (hash) STR "STR" { $hash = $1 } "Hash algorithm to use for signing (MD5,SHA1,RMD160,SHA256,SHA384,SHA512)."
108 #int export;
109 option (export-ciphers) { $export=1 } "Use weak encryption algorithms."
111 #int incert_format;
112 option (inder) { $incert_format=1 } "Use DER format for input certificates and private keys."
113 option (inraw) { $incert_format=1 } "Use RAW/DER format for input certificates and private keys."
115 #int outcert_format;
116 option (outder) { $outcert_format=1 } "Use DER format for output certificates and private keys."
117 option (outraw) { $outcert_format=1 } "Use RAW/DER format for output certificates and private keys."
119 #int bits;
120 option (bits) INT "BITS" { $bits = $1 } "specify the number of bits for key generation."
122 #char* sec_param;
123 option (sec-param) STR "PARAM" { $sec_param = $1 } "specify the security level [low|normal|high|ultra]."
125 #int quick_random;
126 option (disable-quick-random) { $quick_random = 0; } "Use /dev/random for key generationg, thus increasing the quality of randomness used."
128 #char *outfile;
129 option (outfile) STR "FILE" { $outfile = $1 } "Output file."
131 #char *infile;
132 option (infile) STR "FILE" { $infile = $1 } "Input file."
134 #char *template;
135 option (template) STR "FILE" { $template = $1 } "Template file to use for non interactive operation."
137 #char *pkcs_cipher;
138 option (pkcs-cipher) STR "CIPHER" { $pkcs_cipher = $1 } "Cipher to use for pkcs operations (3des,3des-pkcs12,aes-128,aes-192,aes-256,rc2-40,arcfour)."
140 #int debug;
141 option (d, debug) INT "LEVEL" { $debug = $1 } "specify the debug level. Default is 1."
143 option (h, help) { gaa_help(); exit(0); } "shows this help text"
145 option (v, version) { certtool_version(); exit(0); } "shows the program's version"
147 init { $bits = 0; $pkcs8 = 0; $privkey = NULL; $ca=NULL; $ca_privkey = NULL;
148         $debug=1; $request = NULL; $infile = NULL; $outfile = NULL; $cert = NULL; 
149         $incert_format = 0; $outcert_format = 0; $action=-1; $pass = NULL; $v1_cert = 0;
150         $export = 0; $template = NULL; $hash=NULL; $fix_key = 0; $quick_random=1; 
151         $privkey_op = 0; $pkcs_cipher = "aes-128"; $crq_extensions=1; }