blob: 64fa6ec3cf1250018a05c20f730152401920324a [file] [log] [blame]
Adam Tkac5bf73fb2010-07-21 09:08:24 +00001/*
2 * Copyright (C) 2006 OCCAM Financial Technology
3 * Copyright (C) 2010 TigerVNC Team
4 *
5 * This is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
9 *
10 * This software is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this software; if not, write to the Free Software
17 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
18 * USA.
19 */
20
21#ifndef __S_SECURITY_X509_H__
22#define __S_SECURITY_X509_H__
23
24#ifdef HAVE_CONFIG_H
25#include <config.h>
26#endif
27
28#ifndef HAVE_GNUTLS
29#error "This header should not be compiled without HAVE_GNUTLS defined"
30#endif
31
32#include <rfb/SSecurityTLSBase.h>
33#include <rfb/SSecurityVeNCrypt.h>
34
35namespace rfb {
36
37 class SSecurityX509 : public SSecurityTLSBase {
38 public:
39 SSecurityX509();
40 virtual ~SSecurityX509();
41 virtual int getType() const { return secTypeX509None; }
42
43 static StringParameter X509_CertFile;
44 static StringParameter X509_KeyFile;
45
46 protected:
47 virtual void freeResources();
48 virtual void setParams(gnutls_session session);
49
50 private:
51 static void initGlobal();
52
53 gnutls_dh_params dh_params;
54 gnutls_certificate_credentials cert_cred;
55 char* keyfile;
56 char* certfile;
57 };
58
59}
60
61#endif /* __S_SECURITY_TLS_H__ */