Loading...
Searching...
No Matches
DcmTLSConnection Class Reference

this class represents a TLS (Transport Layer Security) V1 based secure transport connection. More...

Inheritance diagram for DcmTLSConnection:

## Public Member Functions

| DcmTLSConnection (DcmNativeSocketType openSocket, SSL *newTLSConnection)
| constructor.
virtual | ~DcmTLSConnection ()
| destructor
virtual OFCondition | serverSideHandshake ()
| performs server side handshake on established socket.
virtual OFCondition | clientSideHandshake ()
| performs client side handshake on established socket.
virtual OFCondition | renegotiate (const char *newSuite)
| performs a re-negotiation of the connection with different connection parameters.
virtual ssize_t | read (void *buf, size_t nbyte)
| attempts to read nbyte bytes from the transport connection and writes them into the given buffer.
virtual ssize_t | write (void *buf, size_t nbyte)
| attempts to write nbyte bytes from the given buffer to the transport connection.
virtual void | close ()
| Closes the transport connection.
virtual void | closeTransportConnection ()
| Closes the transport connection directly.
virtual unsigned long | getPeerCertificateLength ()
| returns the size in bytes of the peer certificate of a secure connection.
virtual OFBool | networkDataAvailable (int timeout)
| checks if data is available to be read on the transport connection.
virtual OFBool | isTransparentConnection ()
| returns OFTrue if this connection is a transparent TCP connection, OFFalse if the connection is a secure connection.
virtual OFString & | dumpConnectionParameters (OFString &str)
| dump the characteristics of the current connection
Public Member Functions inherited from DcmTransportConnection
| DcmTransportConnection (DcmNativeSocketType openSocket)
| constructor.
virtual | ~DcmTransportConnection ()
| destructor
virtual void | setParentProcessMode ()
| this method must be called by the parent process after a fork() if the TLS connection is handled by the child process.
virtual OFBool | isParentProcessMode () const
| check if the connection has been set to parent process mode by a prior call to setParentProcessMode().
OFdeprecated void | dumpConnectionParameters (STD_NAMESPACE ostream &out)
| prints the characteristics of the current connection on the given output stream.

## Private Member Functions

| DcmTLSConnection (const DcmTLSConnection &)
| private undefined copy constructor
DcmTLSConnection & | operator= (const DcmTLSConnection &)
| private undefined assignment operator
void | logTLSConnection ()
| dump TLS connection details to debug logger

## Private Attributes

SSL * | tlsConnection
| pointer to the TLS connection structure used by the OpenSSL library

## Additional Inherited Members

Static Public Member Functions inherited from DcmTransportConnection
static OFBool | selectReadableAssociation (DcmTransportConnection *connections[], int connCount, int timeout)
| indicates which of the specified transport connections is ready for reading.
Protected Member Functions inherited from DcmTransportConnection
DcmNativeSocketType | getSocket ()
| returns the socket file descriptor managed by this object.
void | setSocket (DcmNativeSocketType socket)
| set the socket file descriptor managed by this object.

## Detailed Description

this class represents a TLS (Transport Layer Security) V1 based secure transport connection.

Remarks
  This class is only available if DCMTK is compiled with OpenSSL support enabled.

## Constructor & Destructor Documentation

## DcmTLSConnection()

DcmTLSConnection::DcmTLSConnection | ( | DcmNativeSocketType | openSocket,
|  | SSL * | newTLSConnection )

constructor.

Parameters

  openSocket | TCP/IP socket to be used for the transport connection. the connection must already be established on socket level. This object takes over control of the socket.
  newTLSConnection | pointer to initialized OpenSSL connection object to be used for this connection.

Referenced by DcmTLSConnection(), and operator=().

## Member Function Documentation

## clientSideHandshake()

virtual OFCondition DcmTLSConnection::clientSideHandshake | ( |  | ) |

virtual

performs client side handshake on established socket.

This function is used to establish a secure transport connection over the established TCP connection.

Returns
  EC_Normal if successful, an error code otherwise.

Implements DcmTransportConnection.

## close()

virtual void DcmTLSConnection::close | ( |  | ) |

virtual

Closes the transport connection.

If a secure connection is used, a closure alert is sent before the connection is closed.

Implements DcmTransportConnection.

## closeTransportConnection()

virtual void DcmTLSConnection::closeTransportConnection | ( |  | ) |

virtual

Closes the transport connection directly.

If a secure connection is used, a closure alert is NOT sent before the connection is closed.

Implements DcmTransportConnection.

## dumpConnectionParameters()

virtual OFString & DcmTLSConnection::dumpConnectionParameters | ( | OFString & | str | ) |

virtual

dump the characteristics of the current connection

Parameters

  str | the string to dump into

Returns
  reference to string

Implements DcmTransportConnection.

## getPeerCertificateLength()

virtual unsigned long DcmTLSConnection::getPeerCertificateLength | ( |  | ) |

virtual

returns the size in bytes of the peer certificate of a secure connection.

Returns
  peer certificate length in bytes

Implements DcmTransportConnection.

## networkDataAvailable()

virtual OFBool DcmTLSConnection::networkDataAvailable | ( | int | timeout | ) |

virtual

checks if data is available to be read on the transport connection.

Parameters

  timeout | maximum number of seconds to wait if no data is available. If this parameter is 0, the function does not block.

Returns
  OFTrue if data is available, OFFalse otherwise.

Implements DcmTransportConnection.

## read()

virtual ssize_t DcmTLSConnection::read | ( | void * | buf,
|  | size_t | nbyte )

virtual

attempts to read nbyte bytes from the transport connection and writes them into the given buffer.

Parameters

  buf | buffer
  nbyte | number of bytes to read

Returns
  number of bytes read, negative number if unsuccessful.

Implements DcmTransportConnection.

## renegotiate()

virtual OFCondition DcmTLSConnection::renegotiate | ( | const char * | newSuite | ) |

virtual

performs a re-negotiation of the connection with different connection parameters.

Used to change the parameters of the secure transport connection.

Parameters

  newSuite | string identifying the ciphersuite to be negotiated.

Returns
  EC_Normal if successful, an error code otherwise.

Implements DcmTransportConnection.

## serverSideHandshake()

virtual OFCondition DcmTLSConnection::serverSideHandshake | ( |  | ) |

virtual

performs server side handshake on established socket.

This function is used to establish a secure transport connection over the established TCP connection.

Returns
  EC_Normal if successful, an error code otherwise.

Implements DcmTransportConnection.

## write()

virtual ssize_t DcmTLSConnection::write | ( | void * | buf,
|  | size_t | nbyte )

virtual

attempts to write nbyte bytes from the given buffer to the transport connection.

Parameters

  buf | buffer
  nbyte | number of bytes to write

Returns
  number of bytes written, negative number if unsuccessful.

Implements DcmTransportConnection.

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

- dcmtls/include/dcmtk/dcmtls/tlstrans.h

Generated on for DCMTK Version 3.7.0 by Doxygen 1.15.0