corrected news entry.
[gnutls.git] / src / certtool-common.h
blobdbd69e5a09e3dca855da6b0438e07807a66d2741
1 /*
2 * Copyright (C) 2003-2012 Free Software Foundation, Inc.
4 * This file is part of GnuTLS.
6 * GnuTLS is free software: you can redistribute it and/or modify it
7 * under the terms of the GNU General Public License as published by
8 * the Free Software Foundation, either version 3 of the License, or
9 * (at your option) any later version.
11 * GnuTLS is distributed in the hope that it will be useful, but
12 * WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program. If not, see
18 * <http://www.gnu.org/licenses/>.
21 #ifndef CERTTOOL_COMMON_H
22 #define CERTTOOL_COMMON_H
24 #include <gnutls/x509.h>
25 #include <stdio.h>
27 #define TYPE_CRT 1
28 #define TYPE_CRQ 2
30 void certtool_version (void);
32 #include <gnutls/x509.h>
33 #include <gnutls/abstract.h>
35 typedef struct common_info
37 const char *secret_key;
38 const char *privkey;
39 const char *pubkey;
40 int pkcs8;
41 int incert_format;
42 const char *cert;
44 const char *request;
45 const char *ca;
46 const char *ca_privkey;
47 int bits;
48 const char* sec_param;
49 const char* pkcs_cipher;
50 const char* password;
51 unsigned int crq_extensions;
52 unsigned int v1_cert;
53 } common_info_st;
55 gnutls_pubkey_t load_public_key_or_import(int mand, gnutls_privkey_t privkey, common_info_st * info);
56 gnutls_privkey_t load_private_key (int mand, common_info_st * info);
57 gnutls_x509_privkey_t load_x509_private_key (int mand, common_info_st * info);
58 gnutls_x509_crq_t load_request (common_info_st * info);
59 gnutls_privkey_t load_ca_private_key (common_info_st * info);
60 gnutls_x509_crt_t load_ca_cert (common_info_st * info);
61 gnutls_x509_crt_t load_cert (int mand, common_info_st * info);
62 gnutls_datum_t *load_secret_key (int mand, common_info_st * info);
63 gnutls_pubkey_t load_pubkey (int mand, common_info_st * info);
64 gnutls_x509_crt_t *load_cert_list (int mand, size_t * size,
65 common_info_st * info);
66 int get_bits (gnutls_pk_algorithm_t key_type, int info_bits, const char* info_sec_param);
67 gnutls_sec_param_t str_to_sec_param (const char *str);
69 /* prime.c */
70 int generate_prime (int how, common_info_st * info);
71 void dh_info (common_info_st * ci);
73 FILE *safe_open_rw (const char *file, int privkey_op);
75 extern unsigned char buffer[];
76 extern const int buffer_size;
79 #endif