DCMTK Version 3.6.9 OFFIS DICOM Toolkit

Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | Protected Attributes | List of all members
DcmTLSOptionsBase Class Reference

A class that handles the TLS options for DCMTK applications. More...

Inheritance diagram for DcmTLSOptionsBase:

## Public Member Functions
| DcmTLSOptionsBase (T_ASC_NetworkRole networkRole)
| Constructor.
virtual | ~DcmTLSOptionsBase ()
| Destructor.
virtual OFCondition | writeRandomSeed ()
| Update the random seed file if this was requested by the given command line arguments.
virtual OFBool | secureConnectionRequested () const
| Returns true if a secure connection was requested, false otherwise.
virtual DcmTransportLayer * | getTransportLayer ()
| Returns a pointer to the transport layer object, or NULL if the object has not yet been created by a call to createTransportLayer().
virtual OFCondition | verifyClientCertificate (const char *fileName)
| loads a certificate or certificate chain from a file and checks whether it can be verified against the current settings of the trust store.
virtual OFCondition | isRootCertificate (const char *fileName)
| loads a certificate file and checks whether it is a valid (e.g.

## Static Public Member Functions
static OFBool | listOfCiphersRequested (OFCommandLine &cmd)
| checks if the command line option –list-ciphers was given.
static OFBool | listOfProfilesRequested (OFCommandLine &cmd)
| checks if the command line option –list-profiles was given.
static void | printSupportedCiphersuites (OFConsoleApplication &app, STD_NAMESPACE ostream &os)
| print a list of supported ciphersuites to the given output stream
static void | printSupportedTLSProfiles (OFConsoleApplication &app, STD_NAMESPACE ostream &os)
| print a list of supported TLS profiles to the given output stream
static void | printLibraryVersion ()
| Print OpenSSL library version string.

## Protected Attributes
DcmKeyFileFormat | opt_keyFileFormat
| flag indicating the file format of certificates and private keys: PEM or ASN.1
OFBool | opt_doAuthenticate
| flag indicating whether we will authenticate ourselves using a certificate and private key
const char * | opt_privateKeyFile
| filename of private key file we use to authenticate ourselves
const char * | opt_certificateFile
| filename of certificate file we use to authenticate ourselves
const char * | opt_passwd
| password for reading the private key file, may be NULL.
DcmTLSSecurityProfile | opt_tlsProfile
| DICOM TLS Security Profile selected.
const char * | opt_readSeedFile
| filename of file containing at least 1K of entropy used to seed the PRNG
const char * | opt_writeSeedFile
| filename to which the modified PRNG state is written back
DcmCertificateVerification | opt_certVerification
| indicates whether we should verify the remote peer's certificate
const char * | opt_dhparam
| filename of Diffie-Hellman parameters file, may be NULL
OFBool | opt_secureConnection
| a flag indicating whether or not a secure connection was requested
T_ASC_NetworkRole | opt_networkRole
| indicates whether we act as client, server or both
const char * | opt_clientSNI
| SNI server name to be requested in outgoing connections.
const char * | opt_serverSNI
| SNI server name to be expected in incoming connections.
DcmTLSCRLVerification | opt_crlMode
| CRL verification mode.
DcmTLSTransportLayer * | tLayer
| pointer to the secure transport layer managed by this object

## Detailed Description

A class that handles the TLS options for DCMTK applications.

DcmTLSOptionsBase allows a derived class to store the relevant options and to create a DcmTLSTransportLayer object based on the collected information.

## Constructor & Destructor Documentation

## ◆ DcmTLSOptionsBase()

DcmTLSOptionsBase::DcmTLSOptionsBase | ( | T_ASC_NetworkRole | networkRole | ) |

Constructor.

Parameters

  networkRole | the network role to create a transport layer for

## Member Function Documentation

## ◆ getTransportLayer()

virtual DcmTransportLayer * DcmTLSOptionsBase::getTransportLayer | ( |  | ) |
| virtual

Returns a pointer to the transport layer object, or NULL if the object has not yet been created by a call to createTransportLayer().

Returns
  pointer to transport layer object, may be NULL.

## ◆ isRootCertificate()

virtual OFCondition DcmTLSOptionsBase::isRootCertificate | ( | const char * | fileName | ) |
| virtual

loads a certificate file and checks whether it is a valid (e.g.

non-expired), self-signed root certificate that can be verified against itself

Parameters

  fileName | path to the certificate file

Returns
  EC_Normal if certificate is a root certificate, an error code otherwise

## ◆ listOfCiphersRequested()

static OFBool DcmTLSOptionsBase::listOfCiphersRequested | ( | OFCommandLine & | cmd | ) |
| static

checks if the command line option –list-ciphers was given.

In this case the list of supported TLS ciphersuites should be printed to stdout and the application should terminate.

Parameters

  cmd | the command line that was used

Returns
  true if –list-ciphers option was found, false otherwise.

## ◆ listOfProfilesRequested()

static OFBool DcmTLSOptionsBase::listOfProfilesRequested | ( | OFCommandLine & | cmd | ) |
| static

checks if the command line option –list-profiles was given.

In this case the list of supported TLS profiles should be printed to stdout and the application should terminate.

Parameters

  cmd | the command line that was used

Returns
  true if –list-profiles option was found, false otherwise.

## ◆ printLibraryVersion()

static void DcmTLSOptionsBase::printLibraryVersion | ( |  | ) |
| static

Print OpenSSL library version string.

Does nothing if OpenSSL is not available.

## ◆ printSupportedCiphersuites()

static void DcmTLSOptionsBase::printSupportedCiphersuites | ( | OFConsoleApplication & | app,
|  | STD_NAMESPACE ostream & | os )
| static

print a list of supported ciphersuites to the given output stream

Parameters

  app | a reference to an OFConsoleApplication object used in the calling application.
  os | output stream

## ◆ printSupportedTLSProfiles()

static void DcmTLSOptionsBase::printSupportedTLSProfiles | ( | OFConsoleApplication & | app,
|  | STD_NAMESPACE ostream & | os )
| static

print a list of supported TLS profiles to the given output stream

Parameters

  app | a reference to an OFConsoleApplication object used in the calling application.
  os | output stream

## ◆ secureConnectionRequested()

virtual OFBool DcmTLSOptionsBase::secureConnectionRequested | ( |  | ) | const
| virtual

Returns true if a secure connection was requested, false otherwise.

Caller must ensure that parseArguments() has been run before this method.

Returns
  true if secure connection requested, false otherwise

## ◆ verifyClientCertificate()

virtual OFCondition DcmTLSOptionsBase::verifyClientCertificate | ( | const char * | fileName | ) |
| virtual

loads a certificate or certificate chain from a file and checks whether it can be verified against the current settings of the trust store.

Parameters

  fileName | path to the certificate file

Returns
  EC_Normal if verification succeeded, an error code otherwise

## ◆ writeRandomSeed()

virtual OFCondition DcmTLSOptionsBase::writeRandomSeed | ( |  | ) |
| virtual

Update the random seed file if this was requested by the given command line arguments.

Returns
  EC_Normal if the random seed file was successfully updated or if the user did not request the random seed file to be update. An error condition indicating what went wrong in case the random seed file could not be updated.

## Member Data Documentation

## ◆ opt_certificateFile

const char* DcmTLSOptionsBase::opt_certificateFile
| protected

filename of certificate file we use to authenticate ourselves

Remarks
  this member is only available if DCMTK is compiled with OpenSSL support enabled.

## ◆ opt_certVerification

DcmCertificateVerification DcmTLSOptionsBase::opt_certVerification
| protected

indicates whether we should verify the remote peer's certificate

Remarks
  this member is only available if DCMTK is compiled with OpenSSL support enabled.

## ◆ opt_clientSNI

const char* DcmTLSOptionsBase::opt_clientSNI
| protected

SNI server name to be requested in outgoing connections.

Remarks
  this member is only available if DCMTK is compiled with OpenSSL support enabled.

## ◆ opt_crlMode

DcmTLSCRLVerification DcmTLSOptionsBase::opt_crlMode
| protected

CRL verification mode.

Remarks
  this member is only available if DCMTK is compiled with OpenSSL support enabled.

## ◆ opt_dhparam

const char* DcmTLSOptionsBase::opt_dhparam
| protected

filename of Diffie-Hellman parameters file, may be NULL

Remarks
  this member is only available if DCMTK is compiled with OpenSSL support enabled.

## ◆ opt_doAuthenticate

OFBool DcmTLSOptionsBase::opt_doAuthenticate
| protected

flag indicating whether we will authenticate ourselves using a certificate and private key

Remarks
  this member is only available if DCMTK is compiled with OpenSSL support enabled.

## ◆ opt_keyFileFormat

DcmKeyFileFormat DcmTLSOptionsBase::opt_keyFileFormat
| protected

flag indicating the file format of certificates and private keys: PEM or ASN.1

Remarks
  this member is only available if DCMTK is compiled with OpenSSL support enabled.

## ◆ opt_passwd

const char* DcmTLSOptionsBase::opt_passwd
| protected

password for reading the private key file, may be NULL.

In this case the password is read from STDIN.

Remarks
  this member is only available if DCMTK is compiled with OpenSSL support enabled.

## ◆ opt_privateKeyFile

const char* DcmTLSOptionsBase::opt_privateKeyFile
| protected

filename of private key file we use to authenticate ourselves

Remarks
  this member is only available if DCMTK is compiled with OpenSSL support enabled.

## ◆ opt_readSeedFile

const char* DcmTLSOptionsBase::opt_readSeedFile
| protected

filename of file containing at least 1K of entropy used to seed the PRNG

Remarks
  this member is only available if DCMTK is compiled with OpenSSL support enabled.

## ◆ opt_secureConnection

OFBool DcmTLSOptionsBase::opt_secureConnection
| protected

a flag indicating whether or not a secure connection was requested

Remarks
  this member is only available if DCMTK is compiled with OpenSSL support enabled.

## ◆ opt_serverSNI

const char* DcmTLSOptionsBase::opt_serverSNI
| protected

SNI server name to be expected in incoming connections.

Remarks
  this member is only available if DCMTK is compiled with OpenSSL support enabled.

## ◆ opt_tlsProfile

DcmTLSSecurityProfile DcmTLSOptionsBase::opt_tlsProfile
| protected

DICOM TLS Security Profile selected.

Remarks
  this member is only available if DCMTK is compiled with OpenSSL support enabled.

## ◆ opt_writeSeedFile

const char* DcmTLSOptionsBase::opt_writeSeedFile
| protected

filename to which the modified PRNG state is written back

Remarks
  this member is only available if DCMTK is compiled with OpenSSL support enabled.

## ◆ tLayer

DcmTLSTransportLayer* DcmTLSOptionsBase::tLayer
| protected

pointer to the secure transport layer managed by this object

Remarks
  this member is only available if DCMTK is compiled with OpenSSL support enabled.

The documentation for this class was generated from the following file:

- dcmtls/include/dcmtk/dcmtls/tlsopt.h

Generated on Sat Mar 1 2025 for DCMTK Version 3.6.9 by Doxygen 1.13.2