DCMTK  Version 3.6.1 20150924
OFFIS DICOM Toolkit
Public Member Functions | Private Member Functions | Private Attributes | List of all members
DcmTLSSCU Class Reference

Base class for implementing DICOM TLS-enabled Service Class User functionality. More...

+ Inheritance diagram for DcmTLSSCU:

Public Member Functions

 DcmTLSSCU ()
 Constructor, just initializes internal class members.
 
 DcmTLSSCU (const OFString &peerHost, const OFString &peerAETitle, const Uint16 portNum)
 Initialize SCU with connection peer information. More...
 
virtual ~DcmTLSSCU ()
 Virtual destructor.
 
virtual OFCondition initNetwork ()
 Initialize network, i.e. More...
 
virtual OFCondition negotiateAssociation ()
 Negotiate association by using presentation contexts and parameters as defined by earlier function calls. More...
 
virtual void closeAssociation (const DcmCloseAssociationType closeType)
 Closes the association of this SCU. More...
 
virtual void addTrustedCertFile (const OFString &str)
 TODO: Not documented yet. More...
 
virtual void addTrustedCertDir (const OFString &certDir)
 TODO: Not documented yet. More...
 
virtual void enableAuthentication (const OFString &privateKey, const OFString &certFile, const char *passphrase=NULL, const int privKeyFormat=SSL_FILETYPE_PEM, const int certFormat=SSL_FILETYPE_PEM)
 TODO: Not documented yet. More...
 
virtual void disableAuthentication ()
 Disables authentication. More...
 
virtual void addCiphersuite (const OFString &cs)
 TODO: Not documented yet. More...
 
virtual void setReadSeedFile (const OFString &seedFile)
 TODO: Not documented yet. More...
 
virtual void setWriteSeedFile (const OFString &seedFile)
 TODO: Not documented yet. More...
 
virtual void setPeerCertVerification (const DcmCertificateVerification cert)
 Set whether peer's certificate must be there, only is checked if there or is ignored. More...
 
virtual void setDHParam (const OFString &dhParam)
 Not documented yet. More...
 
virtual OFBool getAuthenticationParams (OFString &privKeyFile, OFString &certFile, const char *&passphrase, int &privKeyFormat, int &certFormat) const
 Returns OFTrue if authentication is enabled. More...
 
virtual void getTrustedCertFiles (OFList< OFString > &files) const
 TODO: Not documented yet. More...
 
virtual void getTrustedCertDirs (OFList< OFString > &trustedDirs) const
 TODO: Not documented yet. More...
 
virtual OFString getCiphersuites () const
 TODO: Not documented yet. More...
 
virtual OFString getReadSeedFile () const
 TODO: Not documented yet. More...
 
virtual OFString getWriteSeedFile () const
 TODO: Not documented yet. More...
 
virtual OFString getDHParam () const
 TODO: Not documented yet. More...
 
- Public Member Functions inherited from DcmSCU
 DcmSCU ()
 Constructor, just initializes internal class members.
 
virtual ~DcmSCU ()
 Virtual destructor.
 
OFCondition addPresentationContext (const OFString &abstractSyntax, const OFList< OFString > &xferSyntaxes, const T_ASC_SC_ROLE role=ASC_SC_ROLE_DEFAULT)
 Add presentation context to be used for association negotiation. More...
 
T_ASC_PresentationContextID findPresentationContextID (const OFString &abstractSyntax, const OFString &transferSyntax)
 After negotiation association, this call returns the first usable presentation context given the desired abstract syntax and transfer syntax. More...
 
T_ASC_PresentationContextID findAnyPresentationContextID (const OFString &abstractSyntax, const OFString &transferSyntax)
 After a successful association negotiation, this function is called to return the presentation context ID that best matches the desired abstract syntax and transfer syntax (TS). More...
 
virtual OFCondition sendECHORequest (const T_ASC_PresentationContextID presID)
 This function sends a C-ECHO command via network to another DICOM application. More...
 
virtual OFCondition sendSTORERequest (const T_ASC_PresentationContextID presID, const OFString &dicomFile, DcmDataset *dataset, Uint16 &rspStatusCode, const OFString &moveOriginatorAETitle="", const Uint16 moveOriginatorMsgID=0)
 This function sends a C-STORE request on the currently opened association and receives the corresponding response then. More...
 
virtual OFCondition sendMOVERequest (const T_ASC_PresentationContextID presID, const OFString &moveDestinationAETitle, DcmDataset *dataset, OFList< RetrieveResponse * > *responses)
 Sends a C-MOVE Request on given presentation context and receives list of responses. More...
 
virtual OFCondition handleMOVEResponse (const T_ASC_PresentationContextID presID, RetrieveResponse *response, OFBool &waitForNextResponse)
 This is the standard handler for C-MOVE message responses: It just adds up all responses it receives and prints a DEBUG message. More...
 
virtual OFCondition sendCGETRequest (const T_ASC_PresentationContextID presID, DcmDataset *dataset, OFList< RetrieveResponse * > *responses)
 Sends a C-GET Request on given presentation context and receives list of responses. More...
 
virtual OFCondition handleCGETSession (const T_ASC_PresentationContextID presID, DcmDataset *dataset, OFList< RetrieveResponse * > *responses)
 Does the logic for switching between C-GET Response and C-STORE Requests. More...
 
virtual OFCondition handleCGETResponse (const T_ASC_PresentationContextID presID, RetrieveResponse *response, OFBool &continueCGETSession)
 Function handling a single C-GET Response. More...
 
virtual OFCondition handleSTORERequest (const T_ASC_PresentationContextID presID, DcmDataset *incomingObject, OFBool &continueCGETSession, Uint16 &cStoreReturnStatus)
 Function handling a single C-STORE Request. More...
 
virtual OFCondition handleSTORERequestFile (T_ASC_PresentationContextID *presID, const OFString &filename, T_DIMSE_C_StoreRQ *request)
 Function handling a single C-STORE Request. More...
 
virtual OFCondition sendFINDRequest (const T_ASC_PresentationContextID presID, DcmDataset *queryKeys, OFList< QRResponse * > *responses)
 Sends a C-FIND Request on given presentation context and receives list of responses. More...
 
virtual OFCondition handleFINDResponse (const T_ASC_PresentationContextID presID, QRResponse *response, OFBool &waitForNextResponse)
 This is the standard handler for C-FIND message responses: It just adds up all responses it receives and prints a DEBUG message. More...
 
virtual OFCondition sendCANCELRequest (const T_ASC_PresentationContextID presID)
 Send C-CANCEL and, therefore, ends the C-FIND -GET or -MOVE session, i.e. no further responses will be handled. More...
 
virtual OFCondition sendACTIONRequest (const T_ASC_PresentationContextID presID, const OFString &sopInstanceUID, const Uint16 actionTypeID, DcmDataset *reqDataset, Uint16 &rspStatusCode)
 This function sends a N-ACTION request on the currently opened association and receives the corresponding response then. More...
 
virtual OFCondition sendEVENTREPORTRequest (const T_ASC_PresentationContextID presID, const OFString &sopInstanceUID, const Uint16 eventTypeID, DcmDataset *reqDataset, Uint16 &rspStatusCode)
 This function sends N-EVENT-REPORT request and receives the corresponding response. More...
 
virtual OFCondition handleEVENTREPORTRequest (DcmDataset *&reqDataset, Uint16 &eventTypeID, const int timeout=0)
 Receives N-EVENT-REPORT request on the currently opened association and sends a corresponding response. More...
 
virtual OFCondition releaseAssociation ()
 Releases the current association by sending an A-RELEASE request to the SCP. More...
 
virtual OFCondition abortAssociation ()
 Aborts the current association by sending an A-ABORT request to the SCP. More...
 
void setMaxReceivePDULength (const Uint32 maxRecPDU)
 Set maximum PDU length (to be received by SCU) More...
 
void setDIMSEBlockingMode (const T_DIMSE_BlockingMode blockingMode)
 Set whether to send in DIMSE blocking or non-blocking mode. More...
 
void setAETitle (const OFString &myAETtitle)
 Set SCU's AE title to be used in association negotiation. More...
 
void setPeerHostName (const OFString &peerHostName)
 Set SCP's host (hostname or IP address) to talk to in association negotiation. More...
 
void setPeerAETitle (const OFString &peerAETitle)
 Set SCP's AE title to talk to in association negotiation. More...
 
void setPeerPort (const Uint16 peerPort)
 Set SCP's port number to connect to for association negotiation. More...
 
void setDIMSETimeout (const Uint32 dimseTimeout)
 Set timeout for receiving DIMSE messages. More...
 
void setACSETimeout (const Uint32 acseTimeout)
 Set timeout for receiving ACSE messages. More...
 
void setConnectionTimeout (const Sint32 connectionTimeout)
 Set global timeout for connecting to the SCP. More...
 
void setAssocConfigFileAndProfile (const OFString &filename, const OFString &profile)
 Set an association configuration file and profile to be used. More...
 
void setStorageDir (const OFString &storeDir)
 Set the directory that should be used by the standard C-GET handler to store objects that come in with the corresponding C-STORE requests. More...
 
void setStorageMode (const DcmStorageMode storageMode)
 Set the storage mode to be used. More...
 
void setVerbosePCMode (const OFBool mode)
 Set whether to show presentation contexts in verbose or debug mode. More...
 
void setDatasetConversionMode (const OFBool mode)
 Set the mode that specifies whether the transfer syntax of the dataset can be changed for network transmission. More...
 
void setProgressNotificationMode (const OFBool mode)
 Set the mode that specifies whether the progress of sending and receiving DIMSE messages is notified by calling notifySENDProgress() and notifyRECEIVEProgress(), respectively. More...
 
OFBool isConnected () const
 Get current connection status. More...
 
Uint32 getMaxReceivePDULength () const
 Returns maximum PDU length configured to be received by SCU. More...
 
T_DIMSE_BlockingMode getDIMSEBlockingMode () const
 Returns whether DIMSE messaging is configured to be blocking or unblocking. More...
 
const OFStringgetAETitle () const
 Returns the SCU's own configured AE title. More...
 
const OFStringgetPeerHostName () const
 Returns the SCP's (peer's) host name configured. More...
 
const OFStringgetPeerAETitle () const
 Returns the SCP's (peer's) AE title configured. More...
 
Uint16 getPeerPort () const
 Returns the SCP's (peer's) TCP/IP port configured. More...
 
Uint32 getDIMSETimeout () const
 Returns DIMSE timeout in seconds for receiving data. More...
 
Uint32 getACSETimeout () const
 Returns ACSE timeout in seconds used by timer for message timeouts during association negotiation. More...
 
Sint32 getConnectionTimeout () const
 Returns the timeout configured defining how long SCU will wait for the SCP when requesting an association. More...
 
OFString getStorageDir () const
 Returns the storage directory used for storing objects received with C-STORE requests in the context of C-GET sessions. More...
 
DcmStorageMode getStorageMode () const
 Returns the storage mode enabled. More...
 
OFBool getVerbosePCMode () const
 Returns the verbose presentation context mode configured specifying whether details on the presentation contexts (negotiated during association setup) should be shown in verbose or debug mode. More...
 
OFBool getDatasetConversionMode () const
 Returns the mode that specifies whether the transfer syntax of the dataset can be changed for network transmission. More...
 
OFBool getProgressNotificationMode () const
 Returns the mode that specifies whether the progress of sending and receiving DIMSE messages is notified by calling notifySENDProgress() and notifyRECEIVEProgress(), respectively. More...
 
OFBool getTLSEnabled () const
 Returns whether SCU is configured to create a TLS connection with the SCP. More...
 
void freeNetwork ()
 Deletes internal networking structures from memory.
 

Private Member Functions

 DcmTLSSCU (const DcmTLSSCU &src)
 Private undefined copy-constructor. More...
 
DcmTLSSCUoperator= (const DcmTLSSCU &src)
 Private undefined operator=. More...
 

Private Attributes

DcmTLSTransportLayerm_tLayer
 The TLS layer responsible for all encryption/authentication stuff.
 
OFBool m_doAuthenticate
 If enabled, authentication of client/server is enabled.
 
OFList< OFStringm_trustedCertDirs
 A list of directories containing trusted certificates (if authentication is enabled)
 
OFList< OFStringm_trustedCertFiles
 A list of files containing trusted certificates (if authentication is enabled)
 
OFString m_privateKeyFile
 The file containing the private key (if authentication is enabled)
 
int m_privateKeyFileFormat
 Might be either "SSL_FILETYPE_PEM" (default) or "SSL_FILETYPE_ASN1".
 
OFString m_certificateFile
 File containing the certificate the SCU should use for authentication.
 
int m_certKeyFileFormat
 Might be either "SSL_FILETYPE_PEM" (default) or "SSL_FILETYPE_ASN1".
 
char * m_passwd
 Password used for unlocking the private key file. More...
 
OFString m_ciphersuites
 String containing all cipher suites being (additionally? TODO) configured.
 
OFString m_readSeedFile
 TODO: Not documented yet.
 
OFString m_writeSeedFile
 TODO: Not documented yet.
 
DcmCertificateVerification m_certVerification
 Denotes how certificates are handled, i.e. More...
 
OFString m_dhparam
 File containing Diffie-Hellman parameters to be used.
 

Additional Inherited Members

- Protected Member Functions inherited from DcmSCU
OFCondition sendDIMSEMessage (const T_ASC_PresentationContextID presID, T_DIMSE_Message *msg, DcmDataset *dataObject, DcmDataset **commandSet=NULL)
 Sends a DIMSE command and possibly also a dataset from a data object via network to another DICOM application. More...
 
OFCondition getDatasetInfo (DcmDataset *dataset, OFString &sopClassUID, OFString &sopInstanceUID, E_TransferSyntax &transferSyntax)
 Returns SOP Class UID, SOP Instance UID and original transfer syntax for a given dataset. More...
 
OFCondition useSecureConnection (DcmTransportLayer *tlayer)
 Tells DcmSCU to use a secure TLS connection described by the given TLS layer. More...
 
OFCondition receiveDIMSECommand (T_ASC_PresentationContextID *presID, T_DIMSE_Message *msg, DcmDataset **statusDetail, DcmDataset **commandSet=NULL, const Uint32 timeout=0)
 Receive DIMSE command (excluding dataset!) over the currently open association. More...
 
OFCondition receiveDIMSEDataset (T_ASC_PresentationContextID *presID, DcmDataset **dataObject)
 Receives one dataset (of instance data) via network from another DICOM application. More...
 
void clearPresentationContexts ()
 clear list of presentation contexts. More...
 
void findPresentationContext (const T_ASC_PresentationContextID presID, OFString &abstractSyntax, OFString &transferSyntax)
 After negotiation association, this call returns the presentation context belonging to the given presentation context ID. More...
 
virtual void notifyInstanceStored (const OFString &filename, const OFString &sopClassUID, const OFString &sopInstanceUID) const
 This function is called if an object was received due to a C-GET request and can be overwritten by a user in order to be informed about such an event. More...
 
virtual void notifySENDProgress (const unsigned long byteCount)
 This function is called while sending DIMSE messages, i.e. on each PDV of a dataset. More...
 
virtual void notifyRECEIVEProgress (const unsigned long byteCount)
 This function is called while receiving DIMSE messages, i.e. on each PDV of a dataset. More...
 
virtual Uint16 checkEVENTREPORTRequest (T_DIMSE_N_EventReportRQ &request, DcmDataset *reqDataset)
 Check given N-EVENT-REPORT request and dataset for validity. More...
 
virtual OFCondition sendSTOREResponse (T_ASC_PresentationContextID presID, Uint16 status, const T_DIMSE_C_StoreRQ &request)
 Sends back a C-STORE response on the given presentation context, with the designated status, fitting the corresponding C-STORE request. More...
 
virtual OFString createStorageFilename (DcmDataset *dataset)
 Helper function that generates a storage filename by extracting SOP Class and SOP Instance UID from a dataset and combining that with the configured storage directory. More...
 
virtual OFCondition ignoreSTORERequest (T_ASC_PresentationContextID presID, const T_DIMSE_C_StoreRQ &request)
 Receives a DICOM dataset on a given presentation context ID but does not store it in memory or disk, thus ignoring it. More...
 
- Static Protected Member Functions inherited from DcmSCU
static void callbackSENDProgress (void *callbackContext, unsigned long byteCount)
 Callback function used for sending DIMSE messages. More...
 
static void callbackRECEIVEProgress (void *callbackContext, unsigned long byteCount)
 Callback function used for receiving DIMSE messages. More...
 

Detailed Description

Base class for implementing DICOM TLS-enabled Service Class User functionality.

This class is derived from the general DcmSCU class and just adds the corresponding TLS capabilities.

Warning
This class is EXPERIMENTAL. Be careful to use it in production environment.

Constructor & Destructor Documentation

DcmTLSSCU::DcmTLSSCU ( const OFString peerHost,
const OFString peerAETitle,
const Uint16  portNum 
)

Initialize SCU with connection peer information.

Parameters
peerHost[in] The hostname or IP of the host to talk to
peerAETtitle[in] AETitle of peer host to be used
portNum[in] TCP/IP port number to talk to
DcmTLSSCU::DcmTLSSCU ( const DcmTLSSCU src)
private

Private undefined copy-constructor.

Shall never be called.

Parameters
srcSource object

Member Function Documentation

virtual void DcmTLSSCU::addCiphersuite ( const OFString cs)
virtual

TODO: Not documented yet.

Parameters
cs[in] TODO: Not documented yet
virtual void DcmTLSSCU::addTrustedCertDir ( const OFString certDir)
virtual

TODO: Not documented yet.

Parameters
certDir[in] Not documented yet
virtual void DcmTLSSCU::addTrustedCertFile ( const OFString str)
virtual

TODO: Not documented yet.

Parameters
str[in] Not documented yet
virtual void DcmTLSSCU::closeAssociation ( const DcmCloseAssociationType  closeType)
virtual

Closes the association of this SCU.

Deprecated:
The use of this method is deprecated. Please use DcmSCU::releaseAssociation() or DcmSCU::abortAssociation() instead.
Parameters
closeType[in] Define whether to release or abort the association

Reimplemented from DcmSCU.

virtual void DcmTLSSCU::disableAuthentication ( )
virtual

Disables authentication.

However, DcmTLSSCU will try to establish secured connection in terms of encrypting data. Default is that authentication is disabled.

virtual void DcmTLSSCU::enableAuthentication ( const OFString privateKey,
const OFString certFile,
const char *  passphrase = NULL,
const int  privKeyFormat = SSL_FILETYPE_PEM,
const int  certFormat = SSL_FILETYPE_PEM 
)
virtual

TODO: Not documented yet.

Parameters
privateKey[in] File with private key to authenticate with
certFile[in] File with certificate to authenticate with
passphrase[in] Password to access key. NULL asks user on console. "" will send empty password. Default is asking the user to enter password.
privKeyFormat[in] Format of private key parameter. Default is SSL_FILETYPE_PEM.
certFormat[in] Format of certificate file parameter. Default is SSL_FILETYPE_PEM.
virtual OFBool DcmTLSSCU::getAuthenticationParams ( OFString privKeyFile,
OFString certFile,
const char *&  passphrase,
int &  privKeyFormat,
int &  certFormat 
) const
virtual

Returns OFTrue if authentication is enabled.

Parameters
...TODO: Not documented yet
Returns
Return value OFTrue
virtual OFString DcmTLSSCU::getCiphersuites ( ) const
virtual

TODO: Not documented yet.

Returns
TODO: Not documented yet
virtual OFString DcmTLSSCU::getDHParam ( ) const
virtual

TODO: Not documented yet.

Returns
TODO: Not documented yet
virtual OFString DcmTLSSCU::getReadSeedFile ( ) const
virtual

TODO: Not documented yet.

Returns
TODO: Not documented yet
virtual void DcmTLSSCU::getTrustedCertDirs ( OFList< OFString > &  trustedDirs) const
virtual

TODO: Not documented yet.

Parameters
trustedDirs[out] TODO: Not documented yet
virtual void DcmTLSSCU::getTrustedCertFiles ( OFList< OFString > &  files) const
virtual

TODO: Not documented yet.

Parameters
files[out] TODO: Not documented yet
virtual OFString DcmTLSSCU::getWriteSeedFile ( ) const
virtual

TODO: Not documented yet.

Returns
TODO: Not documented yet
virtual OFCondition DcmTLSSCU::initNetwork ( )
virtual

Initialize network, i.e.

prepare for association negotiation.

Returns
EC_Normal if initialization was successful, otherwise error code

Reimplemented from DcmSCU.

virtual OFCondition DcmTLSSCU::negotiateAssociation ( )
virtual

Negotiate association by using presentation contexts and parameters as defined by earlier function calls.

Returns
EC_Normal if negotiation was successful, otherwise error code

Reimplemented from DcmSCU.

DcmTLSSCU& DcmTLSSCU::operator= ( const DcmTLSSCU src)
private

Private undefined operator=.

Shall never be called.

Parameters
srcSource object
Returns
Reference to this
virtual void DcmTLSSCU::setDHParam ( const OFString dhParam)
virtual

Not documented yet.

Parameters
dhParam[in] TODO: Not documented yet
virtual void DcmTLSSCU::setPeerCertVerification ( const DcmCertificateVerification  cert)
virtual

Set whether peer's certificate must be there, only is checked if there or is ignored.

Parameters
cert[in] peer certificate verification mode. The following values are permitted: DCV_requireCertificate, DCV_checkCertificate, DCV_ignoreCertificate
virtual void DcmTLSSCU::setReadSeedFile ( const OFString seedFile)
virtual

TODO: Not documented yet.

Parameters
seedFile[in] TODO: Not documented yet
virtual void DcmTLSSCU::setWriteSeedFile ( const OFString seedFile)
virtual

TODO: Not documented yet.

Parameters
seedFile[in] TODO: Not documented yet

Member Data Documentation

DcmCertificateVerification DcmTLSSCU::m_certVerification
private

Denotes how certificates are handled, i.e.

whether they are required, validated or only validated if present

char* DcmTLSSCU::m_passwd
private

Password used for unlocking the private key file.

If NULL, password is asked from STDIN. If empty string (""), password is sent empty. All others values are sent as given.


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


Generated on Sun Jan 31 2016 for DCMTK Version 3.6.1 20150924 by Doxygen 1.8.9.1