DCMTK  Version 3.6.6
OFFIS DICOM Toolkit
Public Member Functions | Static Public Member Functions | Private Attributes | List of all members
DcmTLSOptions Class Reference

A class that handles the command line arguments used by applications that support TLS. More...

Public Member Functions

 DcmTLSOptions (T_ASC_NetworkRole networkRole)
 Constructor. More...
 
virtual ~DcmTLSOptions ()
 Destructor.
 
void addTLSCommandlineOptions (OFCommandLine &cmd)
 Add TLS specific command line options to the OFCommandLine object passed to the constructor. More...
 
void parseArguments (OFConsoleApplication &app, OFCommandLine &cmd)
 Parse and evaluate the given command line arguments. More...
 
OFCondition createTransportLayer (T_ASC_Network *net, T_ASC_Parameters *params, OFConsoleApplication &app, OFCommandLine &cmd)
 Create a DcmTLSTransportLayer object based on the collected command line arguments. More...
 
OFCondition writeRandomSeed ()
 Update the random seed file if this was requested by the given command line arguments. More...
 
OFBool secureConnectionRequested () const
 Returns true if a secure connection was requested, false otherwise. More...
 
DcmTransportLayergetTransportLayer ()
 Returns a pointer to the transport layer object, or NULL if the object has not yet been created by a call to createTransportLayer(). More...
 

Static Public Member Functions

static OFBool listOfCiphersRequested (OFCommandLine &cmd)
 checks if the command line option –list-ciphers was given. More...
 
static void printSupportedCiphersuites (OFConsoleApplication &app, STD_NAMESPACE ostream &os)
 print a list of supported ciphersuites to the given output stream More...
 
static void printLibraryVersion ()
 Print OpenSSL library version string. More...
 

Private Attributes

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

Detailed Description

A class that handles the command line arguments used by applications that support TLS.

DcmTLSOptions handles storing the relevant options, printing the associated help text an information (e.g. OpenSSL library version), parsing and evaluating the given command line arguments and creating a DcmTLSTransportLayer object based on the collected information.

Constructor & Destructor Documentation

◆ DcmTLSOptions()

DcmTLSOptions::DcmTLSOptions ( T_ASC_NetworkRole  networkRole)

Constructor.

Parameters
networkRolethe network role to create a transport layer for

Member Function Documentation

◆ addTLSCommandlineOptions()

void DcmTLSOptions::addTLSCommandlineOptions ( OFCommandLine cmd)

Add TLS specific command line options to the OFCommandLine object passed to the constructor.

Parameters
cmda reference to an OFCommandLine object used to parse the command line argument give to the calling application.

◆ createTransportLayer()

OFCondition DcmTLSOptions::createTransportLayer ( T_ASC_Network net,
T_ASC_Parameters params,
OFConsoleApplication app,
OFCommandLine cmd 
)

Create a DcmTLSTransportLayer object based on the collected command line arguments.

Parameters
netpointer to network object in which the transport layer should be registered. May be NULL, in which case the caller must activate the transport layer manually using ASC_setTransportLayer().
paramspointer to the association negotiation parameters object. For an association acceptor, this parameter is passed as NULL. If NULL is passed and the caller in an association requestor, then it is the responsibility of the caller to call ASC_setTransportLayerType() and set the right transport layer type for the association parameters.
appa reference to an OFConsoleApplication object used in the calling application.
cmda reference to an OFCommandLine object used to parse the command line argument give to the calling application.
Returns
EC_Normal if successful, an error code otherwise

◆ getTransportLayer()

DcmTransportLayer* DcmTLSOptions::getTransportLayer ( )

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.

◆ listOfCiphersRequested()

static OFBool DcmTLSOptions::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.

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

◆ parseArguments()

void DcmTLSOptions::parseArguments ( OFConsoleApplication app,
OFCommandLine cmd 
)

Parse and evaluate the given command line arguments.

Parameters
appa reference to an OFConsoleApplication object used in the calling application.
cmda reference to an OFCommandLine object used to parse the command line argument give to the calling application.

◆ printLibraryVersion()

static void DcmTLSOptions::printLibraryVersion ( )
static

Print OpenSSL library version string.

Does nothing if OpenSSL is not available.

◆ printSupportedCiphersuites()

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

print a list of supported ciphersuites to the given output stream

Parameters
appa reference to an OFConsoleApplication object used in the calling application.
osoutput stream

◆ secureConnectionRequested()

OFBool DcmTLSOptions::secureConnectionRequested ( ) const

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

◆ writeRandomSeed()

OFCondition DcmTLSOptions::writeRandomSeed ( )

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* DcmTLSOptions::opt_certificateFile
private

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 DcmTLSOptions::opt_certVerification
private

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_dhparam

const char* DcmTLSOptions::opt_dhparam
private

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 DcmTLSOptions::opt_doAuthenticate
private

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 DcmTLSOptions::opt_keyFileFormat
private

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* DcmTLSOptions::opt_passwd
private

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* DcmTLSOptions::opt_privateKeyFile
private

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* DcmTLSOptions::opt_readSeedFile
private

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 DcmTLSOptions::opt_secureConnection
private

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_tlsProfile

DcmTLSSecurityProfile DcmTLSOptions::opt_tlsProfile
private

DICOM TLS Security Profile selected.

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

◆ opt_writeSeedFile

const char* DcmTLSOptions::opt_writeSeedFile
private

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* DcmTLSOptions::tLayer
private

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:


Generated on Thu Jan 14 2021 for DCMTK Version 3.6.6 by Doxygen 1.8.18