]> sourceware.org Git - systemtap.git/blob - nsscommon.h
Fixed systemtap-server.exp
[systemtap.git] / nsscommon.h
1 #ifndef NSS_COMMON_H
2 #define NSS_COMMON_H 1
3
4 /* Used for parameters with default C++ values which are also called from C */
5 #if defined(c_plusplus) || defined(__cplusplus)
6 #define INIT(v,i) v = (i)
7 #else
8 #define INIT(v,i) v
9 #endif
10
11 /* These functions are called from both C and C++. */
12 #if defined(c_plusplus) || defined(__cplusplus)
13 extern "C" {
14 #endif
15
16 #include <pk11func.h>
17 #include "config.h"
18 #if ENABLE_NLS
19 #include <libintl.h>
20 #include <locale.h>
21 #endif
22
23 #if ENABLE_NLS
24 #define _(string) gettext(string)
25 #define _N(string, string_plural, count) \
26 ngettext((string), (string_plural), (count))
27 #else
28 #define _(string) (string)
29 #define _N(string, string_plural, count) \
30 ( (count) == 1 ? (string) : (string_plural) )
31 #endif
32 #define _F(format, ...) autosprintf(_(format), __VA_ARGS__)
33 #define _NF(format, format_plural, count, ...) \
34 autosprintf(_N((format), (format_plural), (count)), __VA_ARGS__)
35
36 char *nssPasswordCallback (PK11SlotInfo *info __attribute ((unused)),
37 PRBool retry __attribute ((unused)),
38 void *arg __attribute ((unused)));
39
40 SECStatus nssInit (const char *db_path, INIT (int readWrite, 0), INIT (int issueMessage, 1));
41 void nssCleanup (const char *db_path);
42
43 void nsscommon_error (const char *msg, INIT(int logit, 1));
44 void nssError (void);
45
46 PRInt32 PR_Read_Complete (PRFileDesc *fd, void *buf, PRInt32 requestedBytes);
47
48 #if defined(c_plusplus) || defined(__cplusplus)
49 }
50 #endif
51
52 #if defined(c_plusplus) || defined(__cplusplus)
53 /* These functions are only called from C++ */
54 #include <string>
55
56 const char *server_cert_nickname ();
57 std::string server_cert_db_path ();
58 std::string local_client_cert_db_path ();
59 std::string add_cert_db_prefix (const std::string &db_path);
60
61 void nsscommon_error (const std::string &msg, int logit = 1);
62
63 void start_log (const char *arg);
64 bool log_ok ();
65 void log (const std::string &msg);
66 void end_log ();
67
68 int check_cert (const std::string &db_path, const std::string &nss_cert_name, bool use_db_password = false);
69 int gen_cert_db (const std::string &db_path, const std::string &extraDnsNames, bool use_password);
70 SECStatus add_client_cert (const std::string &inFileName, const std::string &db_path);
71
72 void sign_file (
73 const std::string &db_path,
74 const std::string &nss_cert_name,
75 const std::string &inputName,
76 const std::string &outputName
77 );
78
79 CERTCertList *get_cert_list_from_db (const std::string &cert_nickname);
80
81 SECStatus
82 read_cert_info_from_file (const std::string &certPath,
83 std::string &fingerprint);
84
85 #endif // defined(c_plusplus) || defined(__cplusplus)
86
87 #endif // NSS_COMMON_H
88
89 /* vim: set sw=2 ts=8 cino=>4,n-2,{2,^-2,t0,(0,u0,w1,M1 : */
This page took 0.04024 seconds and 5 git commands to generate.