2 * Copyright (C) 2008-2012 Free Software Foundation, Inc.
3 * Author: Nikos Mavrogiannopoulos
5 * This file is part of GnuTLS.
7 * GnuTLS is free software: you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation, either version 3 of the License, or
10 * (at your option) any later version.
12 * GnuTLS is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with this program. If not, see <http://www.gnu.org/licenses/>.
25 #include <gnutls/gnutls.h>
26 #include <gnutls/x509.h>
27 #include <gnutls/openpgp.h>
30 static void main_texinfo (void);
31 static void main_latex(void);
36 main (int argc
, char *argv
[])
46 static void main_texinfo (void)
52 gnutls_kx_algorithm_t kx
;
53 gnutls_cipher_algorithm_t cipher
;
54 gnutls_mac_algorithm_t mac
;
55 gnutls_protocol_t version
;
57 printf ("@heading Ciphersuites\n");
58 printf ("@multitable @columnfractions .60 .20 .20\n");
59 printf("@headitem Ciphersuite name @tab TLS ID @tab Since\n");
60 for (i
= 0; (name
= gnutls_cipher_suite_info
61 (i
, id
, &kx
, &cipher
, &mac
, &version
)); i
++)
63 printf ("@item %s\n@tab 0x%02X 0x%02X\n@tab %s\n",
64 escape_texi_string(name
, buffer
, sizeof(buffer
)),
65 (unsigned char) id
[0], (unsigned char) id
[1],
66 gnutls_protocol_get_name (version
));
68 printf ("@end multitable\n");
73 const gnutls_certificate_type_t
*p
= gnutls_certificate_type_list ();
75 printf ("\n\n@heading Certificate types\n");
76 printf ("@table @code\n");
79 printf ("@item %s\n", gnutls_certificate_type_get_name (*p
));
81 printf ("@end table\n");
85 const gnutls_protocol_t
*p
= gnutls_protocol_list ();
87 printf ("\n@heading Protocols\n@table @code\n");
90 printf ("@item %s\n", gnutls_protocol_get_name (*p
));
92 printf ("@end table\n");
96 const gnutls_cipher_algorithm_t
*p
= gnutls_cipher_list ();
98 printf ("\n@heading Ciphers\n@table @code\n");
101 printf ("@item %s\n", gnutls_cipher_get_name (*p
));
103 printf ("@end table\n");
107 const gnutls_mac_algorithm_t
*p
= gnutls_mac_list ();
109 printf ("\n@heading MAC algorithms\n@table @code\n");
112 printf ("@item %s\n", gnutls_mac_get_name (*p
));
114 printf ("@end table\n");
118 const gnutls_kx_algorithm_t
*p
= gnutls_kx_list ();
120 printf ("\n@heading Key exchange methods\n@table @code\n");
123 printf ("@item %s\n", gnutls_kx_get_name (*p
));
125 printf ("@end table\n");
129 const gnutls_pk_algorithm_t
*p
= gnutls_pk_list ();
131 printf ("\n@heading Public key algorithms\n@table @code\n");
134 printf ("@item %s\n", gnutls_pk_get_name (*p
));
136 printf ("@end table\n");
140 const gnutls_sign_algorithm_t
*p
= gnutls_sign_list ();
142 printf ("\n@heading Public key signature algorithms\n@table @code\n");
145 printf ("@item %s\n", gnutls_sign_get_name (*p
));
147 printf ("@end table\n");
151 const gnutls_ecc_curve_t
*p
= gnutls_ecc_curve_list ();
153 printf ("\n@heading Elliptic curves\n@table @code\n");
156 printf ("@item %s\n", gnutls_ecc_curve_get_name (*p
));
158 printf ("@end table\n");
163 const gnutls_compression_method_t
*p
= gnutls_compression_list ();
165 printf ("\n@heading Compression methods\n@table @code\n");
168 printf ("@item %s\n", gnutls_compression_get_name (*p
));
170 printf ("@end table\n");
174 static const char headers
[] = "\\tablefirsthead{%\n"
176 "Ciphersuite name & TLS ID & Since\\\\\n"
181 "\\multicolumn{3}{|l|}{\\small\\sl continued from previous page}\\\\\n"
185 "\\multicolumn{3}{|r|}{\\small\\sl continued on next page}\\\\\n"
188 "\\tablelasttail{\\hline}\n"
189 "\\bottomcaption{The ciphersuites table}\n\n";
191 static void main_latex(void)
199 printf("\\begin{supertabular}{|p{.64\\linewidth}|p{.12\\linewidth}|p{.09\\linewidth}|}\n");
205 gnutls_kx_algorithm_t kx
;
206 gnutls_cipher_algorithm_t cipher
;
207 gnutls_mac_algorithm_t mac
;
208 gnutls_protocol_t version
;
210 for (i
= 0; (name
= gnutls_cipher_suite_info
211 (i
, id
, &kx
, &cipher
, &mac
, &version
)); i
++)
213 printf ("{\\small{%s}} & \\code{0x%02X 0x%02X} & %s",
214 escape_string(name
, buffer
, sizeof(buffer
)),
215 (unsigned char) id
[0], (unsigned char) id
[1],
216 gnutls_protocol_get_name (version
));
219 printf("\\end{supertabular}\n\n");