OFFIS DCMTK
Version 3.6.0
Main Page
Related Pages
Classes
Files
File List
File Members
dcmtls
include
dcmtk
dcmtls
tlslayer.h
1
/*
2
*
3
* Copyright (C) 1998-2010, OFFIS e.V.
4
* All rights reserved. See COPYRIGHT file for details.
5
*
6
* This software and supporting documentation were developed by
7
*
8
* OFFIS e.V.
9
* R&D Division Health
10
* Escherweg 2
11
* D-26121 Oldenburg, Germany
12
*
13
*
14
* Module: dcmtls
15
*
16
* Author: Marco Eichelberg
17
*
18
* Purpose:
19
* classes: DcmTLSTransportLayer
20
*
21
* Last Update: $Author: joergr $
22
* Update Date: $Date: 2010-10-14 13:17:27 $
23
* CVS/RCS Revision: $Revision: 1.9 $
24
* Status: $State: Exp $
25
*
26
* CVS/RCS Log at end of file
27
*
28
*/
29
30
#ifndef TLSLAYER_H
31
#define TLSLAYER_H
32
33
#include "dcmtk/config/osconfig.h"
/* make sure OS specific configuration is included first */
34
#include "dcmtk/dcmnet/dcmlayer.h"
/* for DcmTransportLayer */
35
#include "dcmtk/ofstd/ofstream.h"
/* for ostream */
36
#include "dcmtk/oflog/oflog.h"
37
38
#ifdef WITH_OPENSSL
39
BEGIN_EXTERN_C
40
#include <openssl/ssl.h>
41
END_EXTERN_C
42
43
OFLogger
DCM_dcmtlsGetLogger();
44
45
#define DCMTLS_TRACE(msg) OFLOG_TRACE(DCM_dcmtlsGetLogger(), msg)
46
#define DCMTLS_DEBUG(msg) OFLOG_DEBUG(DCM_dcmtlsGetLogger(), msg)
47
#define DCMTLS_INFO(msg) OFLOG_INFO(DCM_dcmtlsGetLogger(), msg)
48
#define DCMTLS_WARN(msg) OFLOG_WARN(DCM_dcmtlsGetLogger(), msg)
49
#define DCMTLS_ERROR(msg) OFLOG_ERROR(DCM_dcmtlsGetLogger(), msg)
50
#define DCMTLS_FATAL(msg) OFLOG_FATAL(DCM_dcmtlsGetLogger(), msg)
51
56
enum
DcmCertificateVerification
57
{
60
DCV_requireCertificate,
61
64
DCV_checkCertificate,
65
68
DCV_ignoreCertificate
69
};
70
71
79
class
DcmTLSTransportLayer
:
public
DcmTransportLayer
80
{
81
public
:
82
88
DcmTLSTransportLayer
(
int
networkRole,
const
char
*randFile);
89
91
virtual
~DcmTLSTransportLayer
();
92
104
virtual
DcmTransportConnection
*
createConnection
(
int
openSocket, OFBool useSecureLayer);
105
111
DcmTransportLayerStatus
setPrivateKeyFile
(
const
char
*fileName,
int
fileType);
112
118
DcmTransportLayerStatus
setCertificateFile
(
const
char
*fileName,
int
fileType);
119
124
OFBool
checkPrivateKeyMatchesCertificate
();
125
131
DcmTransportLayerStatus
addTrustedCertificateFile
(
const
char
*fileName,
int
fileType);
132
139
DcmTransportLayerStatus
addTrustedCertificateDir
(
const
char
*pathName,
int
fileType);
140
148
DcmTransportLayerStatus
setCipherSuites
(
const
char
*suites);
149
153
static
unsigned
long
getNumberOfCipherSuites
();
154
159
static
const
char
*
getTLSCipherSuiteName
(
unsigned
long
idx);
160
165
static
const
char
*
getOpenSSLCipherSuiteName
(
unsigned
long
idx);
166
171
static
const
char
*
findOpenSSLCipherSuiteName
(
const
char
*tlsCipherSuiteName);
172
177
OFBool
canWriteRandomSeed
() {
return
canWriteRandseed
; }
178
183
OFBool
writeRandomSeed
(
const
char
*randFile);
184
193
void
seedPRNG
(
const
char
*randFile);
194
200
void
addPRNGseed
(
void
*buf,
size_t
bufSize);
201
206
void
setCertificateVerification
(DcmCertificateVerification vtype);
207
214
void
setPrivateKeyPasswd
(
const
char
*thePasswd);
215
219
void
setPrivateKeyPasswdFromConsole
();
220
226
OFBool
setTempDHParameters
(
const
char
*filename);
227
232
static
OFString
dumpX509Certificate
(X509 *peerCertificate);
233
234
private
:
235
237
DcmTLSTransportLayer
(
const
DcmTLSTransportLayer
&);
238
240
DcmTLSTransportLayer
&
operator=
(
const
DcmTLSTransportLayer
&);
241
243
SSL_CTX *
transportLayerContext
;
244
246
OFBool
canWriteRandseed
;
247
249
OFString
privateKeyPasswd
;
250
251
};
252
253
#endif
/* WITH_OPENSSL */
254
255
#endif
256
257
/*
258
* $Log: tlslayer.h,v $
259
* Revision 1.9 2010-10-14 13:17:27 joergr
260
* Updated copyright header. Added reference to COPYRIGHT file.
261
*
262
* Revision 1.8 2009-11-18 12:11:19 uli
263
* Switched to logging mechanism provided by the "new" oflog module.
264
*
265
* Revision 1.7 2006-08-15 16:02:55 meichel
266
* Updated the code in module dcmtls to correctly compile when
267
* all standard C++ classes remain in namespace std.
268
*
269
* Revision 1.6 2005/12/08 16:05:38 meichel
270
* Changed include path schema for all DCMTK header files
271
*
272
* Revision 1.5 2003/12/05 10:38:55 joergr
273
* Removed leading underscore characters from preprocessor symbols (reserved
274
* symbols).
275
*
276
* Revision 1.4 2003/07/04 13:28:32 meichel
277
* Added include for ofstream.h, to make sure ofstream is correctly defined
278
*
279
* Revision 1.3 2001/06/01 15:51:12 meichel
280
* Updated copyright header
281
*
282
* Revision 1.2 2000/10/10 12:13:31 meichel
283
* Added routines for printing certificates and connection parameters.
284
*
285
* Revision 1.1 2000/08/10 14:50:26 meichel
286
* Added initial OpenSSL support.
287
*
288
*
289
*/
290
Generated on Thu Dec 20 2012 for
OFFIS DCMTK
Version 3.6.0 by
Doxygen
1.8.2