Click or drag to resize

Transmitter5InstallCertificates Method

Install signing/encryption certificates (used by SwissDecTX to secure SwissDec transmissions) in the appropriate certificate stores.

Namespace: SwissDecTX
Assembly: SwissDecTX.Transmitter5 (in SwissDecTX.Transmitter5.dll) Version: 5.0.0.0 (5.0.0.0)
Syntax
public void InstallCertificates(
	string rootCertificatePathName,
	string receiverCertificatePathName,
	string transmitterCertificatePathName,
	string password,
	bool perMachineConfiguration
)

Parameters

rootCertificatePathName  String
The fully qualified path name of the file containing the SwissDec Root CA certificate to install. The file is typically named [Your-Product]-swissdecCA.crt
receiverCertificatePathName  String
The fully qualified path name of the file containing the SwissDec receiver certificate to install. The file is typically named Distributor.crt or Distributor2.crt
transmitterCertificatePathName  String
The fully qualified path name of the file containing the SwissDec transmitter certificate to install. The file is typically named [Your-Product].p12
password  String
The password associated with the transmitter certificate (*.p12)
perMachineConfiguration  Boolean
Supplies a flag indicating if the certificates must be installed per-machine (true) or per-user (false, default)
Remarks
You need to call this routine only once per computer to install the three required certificates before making the first transmission. It is possible to install more than one set of certificates, for example a test set and a production set. The calling application can specify which certificate to use by calling SetTransmitterCertificate(String, Transmitter5CertificateSearchMode) and SetReceiverCertificate(String, Transmitter5CertificateSearchMode). You can completely remove the certificate from the machine (i.e. erase the files) after this call completed as they are not needed anymore. Note that your transmitter certificate (*.p12) and its associated password are SECRET and should be safeguarded, never leave them unprotected on the customer's computer.
Example
Calling Transmitter.InstallCertificates()
try {

    var tx = new Transmitter5();

    tx.InstallCertificates(@"C:\Certs\XZYPayroll-swissdecCA.crt", @"C:\Certs\Distributor2.crt", @"C:\Certs\XYZPayroll.p12", "secretPassword", false);

} catch (Exception ex) {

    MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);

}
See Also