L_DicomSetServerCertificateTLS
#include "ltdic.h"
L_LTDIC_API L_UINT32 L_DicomSetServerCertificateTLS(hNet, pszPathToCertificateFile, nCertType, pszPathToKeyFile)
HDICOMNET hNet; |
/* handle to an existing DICOM Network */ |
L_TCHAR *pszPathToCertificateFile; |
/* path to the file that contains the certificate */ |
L_UINT32 nCertType; |
/* certificate type */ |
L_TCHAR *pszPathToKeyFile; |
/* path to the file containing the private key */ |
Sets a certificate for the server. This function is available in the Medical Suite toolkits.
Parameter |
Description |
|
hNet |
Handle to an existing DICOM Network. This is the handle returned from the L_DicomCreateNet function. |
|
pszPathToCertificate |
Character string that contains the path to the file that contains the certificate. |
|
nCertType |
Flag that indicates whether the certificate is binary or text. Possible values are: |
|
|
Value |
Meaning |
|
L_TLS_FILETYPE_PEM |
Text certificate |
|
L_TLS_FILETYPE_ASN1 |
Binary certificate |
pszPathToKeyFile |
Character string that contains the path to the file containing the private key. This parameter is used if the private key is available in raw mode. |
Returns
DICOM_SUCCESS |
Success. |
<>DICOM_SUCCESS |
An error occurred. Refer to the Return Codes. |
Comments
The usual sizes for an RSA key is 512 and 1024 bits. There is a limitation for import in Europe a RSA key must be at least 768 bits long. There are no known export restrictions.
The server is authenticated always. A server may be authenticated with a chain of certificates, all in the same file.
Required DLLs and Libraries
LTDIC For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application |
See Also
Functions: |
|
Topics: |
|
|
|
|
|
|
Example
L_INT DicomSetServerCertificateTLSExample(L_VOID) { HDICOMNET hDicomNet = NULL; L_INT nRet; nRet = L_DicomSetServerCertificateTLS(hDicomNet, TEXT("C:\\Program Files\\LEAD Technologies\\LEADTOOLS 15\\Images\\Server.pem"), L_TLS_FILETYPE_PEM, NULL); if (nRet != DICOM_SUCCESS) return nRet; L_TCHAR strMsg[64]; wsprintf(strMsg, TEXT("Loaded server certificate, result is %s"), nRet?TEXT("Error"):TEXT("Success")); MessageBox(NULL, strMsg, TEXT(""), MB_OK); return DICOM_SUCCESS; }