To assign the certificate for TLS communication to the PLC, use the import-certificate command.
Note
Before a certificate can be imported, you must set up the protection of PLC configuration data.
For example to use the certificate "Certificate.PLC_6.p12" as TLS certificate for "PLC_1", run
apax hwc import-certificate --name "PLC_6" --input "src/Hwc/file.hwl.json" --certificate "D:/Certificates/Certificate.PLC_6.p12" --purpose "TLS" --password "Admin123456!"
This will result in an update of the security configuration file (PLC_1.SecurityConfiguration.json) under the hwc.gen folder and the encrypted private key of the certificate will be persisted.
As shown in the sample file content below, the content of the security configuration file is modified so that CertificateAssignments configuration contains a certificateId value.
{
"PKIData": "AAAAAAAAAAAAAAycycxAAACqAS0tLS0tQ----Rest of the sample content is cut here to prevent degradation of readability",
"CertificateAssignments": {
"TLS": 1
}
}
After importing the TLS certificate, we are ready for generation of a PLC loadable which will contain the certificate information. Generation of the PLC loadable is possible via the compile command.
apax hwc compile --input "src/Hwc/file.hwl.json" --output "bin/hwcOutput/"