Products | Support | Send comments on this topic. | Email a link to this topic. | Back to Getting Started | Help Version 18.0.10.23
LEADTOOLS DICOM C++ Class Library Help

LDicomNet::OnSecureLinkReady

Show in webframe

#include "ltdic.h"

virtual L_VOID LDicomNet::OnSecureLinkReady(nError)

L_UINT32 nError;

/* error code */

This function is called when an ISCL or TLS secured connection is successfully established. This function is available in the PACS Imaging toolkits.

Parameter

Description

nError

Error code. For a list of possible values, refer to Return Codes.

Returns

None.

Comments

This function is called after the ISCL or TLS connection is successfully established. From this moment until the connection is closed, an application can securely send and receive data.

Platforms

Win32, x64

See Also

Topics:

Adding TLS Security to a DICOM Connection

 

Negotiating a Ciphersuite

 

General Transport Layer Secure (TLS) Information

Example

/*<struct>*/
#ifdef LMYDICOMNETEXT
{
class LMyDicomNetExt : public LDicomNet
   {
   public:
      L_INT m_nProcess;
      L_INT m_nClientOrServer;
      L_INT m_nDataCommand;
      L_INT m_FileCount;
      LMyDicomNetExt (L_TCHAR *pszPath, L_INT32 nMode);
      LMyDicomNetExt (L_TCHAR *pszPath, L_INT32 nMode, L_BOOL bReserved);
      virtual ~LMyDicomNetExt ();
      L_VOID    LMyDicomNetExt::OnReceive                 (L_INT nError, L_UCHAR nType, L_UCHAR *pBuffer, L_UINT32 nBytes);//GetErrorSecure
      L_VOID    LMyDicomNetExt::OnSecureLinkReady(L_UINT32 nError);//GetPeerAuthDataISCL
      L_VOID    LMyDicomNetExt::OnConnect();//GetCiphersuiteTLS
      L_VOID    LMyDicomNetExt::OnConnect(LMyDicomNet* pDicomNet);
      L_VOID    LMyDicomNetExt::OnReceiveAssociateRequest(LDicomAssociate *pPDU);
      L_UINT32  LMyDicomNetExt::GetChallengeISCL(L_UINT64 *pChallenge, L_UINT64 nParameter);
      L_UINT32  LMyDicomNetExt::InternalAuthenticateISCL(L_UINT64 nChallenge, L_UINT64 *pResponse, L_UINT64 nParameter);
      L_UINT32  LMyDicomNetExt::ExternalAuthenticateISCL(L_UINT64 nChallenge, L_UINT64 nResponse, L_UINT64 nParameter);
   };
#endif // #ifdef LMyDicomNetExt
/*</struct>*/
L_VOID LMyDicomNetExt::OnSecureLinkReady(L_UINT32 nError)
{
   L_TCHAR str[128];
   if (nError == DICOM_SUCCESS)
   {
      L_CIPHERSUITE tmp;
      tmp = this->GetCiphersuiteTLS();
      if (tmp == TLS_DHE_RSA_WITH_DES_CBC_SHA)
         wsprintf(str, TEXT("Secure connected, cipher is TLS_DHE_RSA_WITH_DES_CBC_SHA"));
      if (tmp == TLS_DHE_RSA_WITH_3DES_EDE_CBC_SHA)
         wsprintf(str, TEXT("Secure connected, cipher is TLS_DHE_RSA_WITH_3DES_EDE_CBC_SHA"));
      AfxMessageBox(str);
   }
   else
   {
      wsprintf(str, TEXT("ClientTLS: Secure link error %d"), nError);
      AfxMessageBox(str);
   }
};
Products | Support | Contact Us | Copyright Notices
© 2006-2014 All Rights Reserved. LEAD Technologies, Inc.