DCMTK
Version 3.6.6
OFFIS DICOM Toolkit
|
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... | |
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(). 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 | |
DcmTLSTransportLayer * | tLayer |
pointer to the secure transport layer managed by this object More... | |
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.
DcmTLSOptions::DcmTLSOptions | ( | T_ASC_NetworkRole | networkRole | ) |
Constructor.
networkRole | the network role to create a transport layer for |
void DcmTLSOptions::addTLSCommandlineOptions | ( | OFCommandLine & | cmd | ) |
Add TLS specific command line options to the OFCommandLine object passed to the constructor.
cmd | a reference to an OFCommandLine object used to parse the command line argument give to the calling application. |
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.
net | pointer 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(). |
params | pointer 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. |
app | a reference to an OFConsoleApplication object used in the calling application. |
cmd | a reference to an OFCommandLine object used to parse the command line argument give to the calling application. |
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().
|
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.
void DcmTLSOptions::parseArguments | ( | OFConsoleApplication & | app, |
OFCommandLine & | cmd | ||
) |
Parse and evaluate the given command line arguments.
app | a reference to an OFConsoleApplication object used in the calling application. |
cmd | a reference to an OFCommandLine object used to parse the command line argument give to the calling application. |
|
static |
Print OpenSSL library version string.
Does nothing if OpenSSL is not available.
|
static |
print a list of supported ciphersuites to the given output stream
app | a reference to an OFConsoleApplication object used in the calling application. |
os | output stream |
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.
OFCondition DcmTLSOptions::writeRandomSeed | ( | ) |
Update the random seed file if this was requested by the given command line arguments.
|
private |
filename of certificate file we use to authenticate ourselves
|
private |
indicates whether we should verify the remote peer's certificate
|
private |
filename of Diffie-Hellman parameters file, may be NULL
|
private |
flag indicating whether we will authenticate ourselves using a certificate and private key
|
private |
flag indicating the file format of certificates and private keys: PEM or ASN.1
|
private |
password for reading the private key file, may be NULL.
In this case the password is read from STDIN.
|
private |
filename of private key file we use to authenticate ourselves
|
private |
filename of file containing at least 1K of entropy used to seed the PRNG
|
private |
a flag indicating whether or not a secure connection was requested
|
private |
DICOM TLS Security Profile selected.
|
private |
filename to which the modified PRNG state is written back
|
private |
pointer to the secure transport layer managed by this object