ExchangeCertificate Method

Exchange a certificate with the remote host.

Syntax

int ExchangeCertificate(int iConnectionId, const QString& qsClientSFIDCode, const QString& qsCertificateStore, int iCertificateExchangeType);

Remarks

If the remote host supports the certificate exchange feature of OFTP 2.0 this method may be used to send and/or request certificates.

The CertificateStore parameter specifies the location of the certificate to be exchanged. In most cases this will be the path to a .cer file on disk. If the certificate is in another format or is installed to the Windows certificate store please see ExchangeCertStoreType and ExchangeCertSubject for more information.

The CertificateExchangeType parameter determines the type of request. Possible values are:

0Request: The class will send the certificate file specified. The remote host will respond with a certificate of it's own. The response may be in a separate session.
1Replace: The class will send the certificate file specified. No certificate is expected in response. The certificate sent here invalidates any previous certificates the remote host has stored.
2Deliver: The class will send the certificate file specified. This is used to respond to a certificate request. It may also be used to send new additional certificates to the remote host. This will not invalidate previous certificates the remote host has stored.

When the remote host sends a certificate to the class the received certificate will be provided through the CertificateReceived event.

Error Handling

This method returns a result code; 0 indicates success, while a non-zero error code indicates that this method encountered an error during its execution. If an error occurs, the GetLastError() method can be called to retrieve the associated error message. (Note: This method's result code can also be obtained by calling the GetLastErrorCode() method after it returns.)

Copyright (c) 2022 /n software inc. - All rights reserved.
IPWorks EDI 2020 Qt Edition - Version 20.0 [Build 8203]