1 #ifndef CERTTOOL_COMMON_H
2 #define CERTTOOL_COMMON_H
4 #include <gnutls/x509.h>
10 ACTION_GENERATE_PRIVKEY
,
12 ACTION_GENERATE_REQUEST
,
13 ACTION_GENERATE_CERTIFICATE
,
16 ACTION_UPDATE_CERTIFICATE
,
26 ACTION_GENERATE_PROXY
,
27 ACTION_GENERATE_PKCS8
,
29 ACTION_PGP_PRIVKEY_INFO
,
39 void certtool_version (void);
41 #include <gnutls/x509.h>
42 #include <gnutls/abstract.h>
44 typedef struct common_info
46 const char *secret_key
;
55 const char *ca_privkey
;
58 gnutls_pubkey_t
load_public_key_or_import(int mand
, gnutls_privkey_t privkey
, common_info_st
* info
);
59 gnutls_privkey_t
load_private_key (int mand
, common_info_st
* info
);
60 gnutls_x509_privkey_t
load_x509_private_key (int mand
, common_info_st
* info
);
61 gnutls_x509_crq_t
load_request (common_info_st
* info
);
62 gnutls_privkey_t
load_ca_private_key (common_info_st
* info
);
63 gnutls_x509_crt_t
load_ca_cert (common_info_st
* info
);
64 gnutls_x509_crt_t
load_cert (int mand
, common_info_st
* info
);
65 gnutls_datum
*load_secret_key (int mand
, common_info_st
* info
);
66 gnutls_pubkey_t
load_pubkey (int mand
, common_info_st
* info
);
67 gnutls_x509_crt_t
*load_cert_list (int mand
, size_t * size
,
68 common_info_st
* info
);
70 /* returns the bits specified in cmd */
71 int get_bits (gnutls_pk_algorithm_t
);
74 int generate_prime (int how
);
76 FILE *safe_open_rw (const char *file
, int privkey_op
);
78 extern unsigned char buffer
[];
79 extern const int buffer_size
;