LDicomNet::OnPrivateKeyPassword

#include "ltdic.h"

virtual L_INT LDicomNet::OnPrivateKeyPassword(pszPassword, nSize, nFlag)

L_TCHAR * pszPassword;

/* character string containing the password*/

L_INT nSize;

/* size of buffer pointed to by pszPassword */

L_INT nFlag;

/* flag specifying how pszPassword is used (encrypt/decrypt) */

The LDicomNet::SetClientCertificateTLS or LDicomNet::SetServerCertificateTLS functions call this function whenever the private key file is password encrypted in order to obtain the password. To use this function, copy the private key into the pszPassword buffer, and have LDicomNet::OnPrivateKeyPassword return the length of the password. This function is available in the Medical Suite Toolkit.

Parameter

Description

pszPassword

(in,out) pointer to a character string buffer to be used to hold the password. Copy the password for the private key file into this buffer.

nSize

(in) size of the buffer pointed to by pszPassword. This is an incoming parameter.

nFlag

(in) flag specifying whether pszPassword is being used for decryption or encryption. Possible values are:

 

Value

Meaning

 

0

The pszPassword is being used for decryption.

 

1

The pszPassword is being used for encryption.

Returns

When processing this function, have LDicomNet::OnPrivateKeyPassword return the length of the password copied into the pszPassword buffer here.

Comments

A call to this virtual function may be generated after a call to LDicomNet::SetClientCertificateTLS or LDicomNet::SetServerCertificateTLS. Calling either of these functions with a private key file that is password encrypted will result in a call to this virtual function in order to obtain the password. To process this function, perform the following steps:

1.

Copy the password used to encrypt the private key into the pszPassword buffer.

2.

Have this function return the length of the password copied into pszPassword.

The nSize and nFlag arguments are provided for information, and should not be changed. The length of the pszPassword buffer is given in the nSize parameter. The input parameter nFlag indicates whether the password is being used for encryption or decryption.

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:

LDicomNet::SetClientCertificateTLS, LDicomNet::SetServerCertificateTLS

Topics:

Adding TLS Security to a DICOM Connection
Working with DICOM Network Connections
|
DICOM Network Connection: TLS Security

Example

For an example, refer to LDicomNet::Initialize.