IPWorks EDI 2020 Node.js Edition

Questions / Feedback?

ExchangeCertificate Method

Exchange a certificate with the remote host.

Syntax

oftpclient.exchangeCertificate(certificateStore, certificateExchangeType, [callback])

Callback

The 'callback' parameter specifies a function which will be called when the operation completes (or an error is encountered). If the 'callback' parameter is not specified, then the method will block and will not return until the operation completes (or an error is encountered).

The callback for this method is defined as:

function(err){ }

'err' is the error that occurred. If there was no error, then 'err' is 'null'.

'err' has 2 properties which hold detailed information:

err.code
err.message

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.

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