[Title] Update spec according to gnutls upgrade to 2.12.20
[external/libgnutls26.git] / src / certtool.gaa
1 #{
2
3 /* C declarations */
4
5 #include <config.h>
6 #ifdef _WIN32
7 # include <io.h>
8 #endif
9
10 #include "certtool-common.h"
11
12 #}
13
14 helpnode "Certtool help\nUsage: certtool [options]"
15
16 #int privkey_op;
17 #int action;
18 option (s, generate-self-signed) { $action=ACTION_SELF_SIGNED; } "Generate a self-signed certificate."
19
20 option (c, generate-certificate) { $action=ACTION_GENERATE_CERTIFICATE; } "Generate a signed certificate."
21
22 option (generate-proxy) { $action=ACTION_GENERATE_PROXY; } "Generate a proxy certificate."
23
24 option (generate-crl) { $action=ACTION_GENERATE_CRL; } "Generate a CRL."
25
26 option (u, update-certificate) { $action=ACTION_UPDATE_CERTIFICATE; } "Update a signed certificate."
27
28 option (p, generate-privkey) { $privkey_op=1; $action=ACTION_GENERATE_PRIVKEY; } "Generate a private key."
29
30 option (q, generate-request) { $privkey_op=1; $action=ACTION_GENERATE_REQUEST; } "Generate a PKCS #10 certificate request."
31
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."
33
34 option (verify-crl) { $action=ACTION_VERIFY_CRL; } "Verify a CRL."
35
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."
38
39 #char *privkey;
40 option (load-privkey) STR "FILE" { $privkey = $1 } "Private key file to use."
41
42 #char *pubkey;
43 option (load-pubkey) STR "FILE" { $pubkey = $1 } "Public key file to use."
44
45 #char *request;
46 option (load-request) STR "FILE" { $request = $1 } "Certificate request file to use."
47
48 #char *cert;
49 option (load-certificate) STR "FILE" { $cert = $1 } "Certificate file to use."
50
51 #char *ca_privkey;
52 option (load-ca-privkey) STR "FILE" { $ca_privkey = $1 } "Certificate authority's private key file to use."
53
54 #char *ca;
55 option (load-ca-certificate) STR "FILE" { $ca = $1 } "Certificate authority's certificate file to use."
56
57 #char *pass;
58 option (password) STR "PASSWORD" { $pass = $1 } "Password to use."
59
60 option (i, certificate-info) { $action = ACTION_CERT_INFO; } "Print information on a certificate."
61
62 option (certificate-pubkey) { $action = ACTION_CERT_PUBKEY; } "Print certificate public key."
63
64 option (pgp-certificate-info) { $action = ACTION_PGP_INFO; } "Print information on a OpenPGP certificate."
65
66 option (pgp-ring-info) { $action = ACTION_RING_INFO; } "Print information on a keyring structure."
67
68 option (l, crl-info) { $action = ACTION_CRL_INFO; } "Print information on a CRL."
69
70 option (crq-info) { $action = ACTION_REQUEST; } "Print information on a Certificate Request."
71
72 #int crq_extensions;
73 option (no-crq-extensions) { $crq_extensions = 0; } "Do not use extensions in certificate requests."
74
75 option (p12-info) { $action = ACTION_PKCS12_INFO; } "Print information on a PKCS #12 structure."
76
77 option (p7-info) { $action = ACTION_P7_INFO; } "Print information on a PKCS #7 structure."
78
79 option (smime-to-p7) { $action = ACTION_SMIME_TO_P7; } "Convert S/MIME to PKCS #7 structure."
80
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."
84
85 option (pgp-key-info) { $privkey_op=1; $action = ACTION_PGP_PRIVKEY_INFO; } "Print information on a OpenPGP private key."
86
87 option (pubkey-info) { $action = ACTION_PUBKEY_INFO; } "Print information on a public key."
88
89 #int fix_key;
90 option (fix-key) { $privkey_op=1; $fix_key = 1; } "Regenerate the parameters in a private key."
91
92 #int v1_cert;
93 option (v1) { $v1_cert = 1; } "Generate an X.509 version 1 certificate (no extensions)."
94
95 option (to-p12) { $action = ACTION_TO_PKCS12; } "Generate a PKCS #12 structure."
96
97 option (to-p8) { $action = ACTION_GENERATE_PKCS8; } "Generate a PKCS #8 key structure."
98
99 #int pkcs8;
100 option (8, pkcs8) { $pkcs8=1 } "Use PKCS #8 format for private keys."
101
102 #int dsa;
103 option (dsa) { $dsa=1 } "Use DSA keys."
104
105 #char *hash;
106 option (hash) STR "STR" { $hash = $1 } "Hash algorithm to use for signing (MD5,SHA1,RMD160,SHA256,SHA384,SHA512)."
107
108 #int export;
109 option (export-ciphers) { $export=1 } "Use weak encryption algorithms."
110
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."
114
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."
118
119 #int bits;
120 option (bits) INT "BITS" { $bits = $1 } "specify the number of bits for key generation."
121
122 #char* sec_param;
123 option (sec-param) STR "PARAM" { $sec_param = $1 } "specify the security level [low|normal|high|ultra]."
124
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."
127
128 #char *outfile;
129 option (outfile) STR "FILE" { $outfile = $1 } "Output file."
130
131 #char *infile;
132 option (infile) STR "FILE" { $infile = $1 } "Input file."
133
134 #char *template;
135 option (template) STR "FILE" { $template = $1 } "Template file to use for non interactive operation."
136
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)."
139
140 #int debug;
141 option (d, debug) INT "LEVEL" { $debug = $1 } "specify the debug level. Default is 1."
142
143 option (h, help) { gaa_help(); exit(0); } "shows this help text"
144
145 option (v, version) { certtool_version(); exit(0); } "shows the program's version"
146
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; }