apax hwc import-certificate --name <PLC_NAME> --input <HARDWARE_DECLARATION> --certificate <CERTIFICATE_FILE_PATH> --password <CERTIFICATE_PASSWORD> --purpose <PURPOSE_OF_CERTIFICATE_USAGE>
- Imports a PKCS12 certificate, which contains public and private keys, into the project. This certificate will be used for the specified purpose. One example is using the certificate for enabling secure (TLS) communication between AX and a PLC.
- Imported certificate's content will be persisted inside the same security configuration file, which is generated by the
setup-secure-communicationcommand. This file contains key-value pairs, where keys are human-readable strings and values are machine-readable byte arrays. - The TLS certificate is a mandatory input for a successful compile of S7-1500 PLCs as Hardware Engineering @AX only supports TLS communication. Therefore
import-certificatecommand must be run at least once with--purpose TLSparameters prior to execution of hwc compile command for S7-1500 PLCs.
- Imported certificate's content will be persisted inside the same security configuration file, which is generated by the
Options
| Option | Description |
|---|---|
| -i, --input | Path to directory or file of the textual hardware declaration for compile. Mandatory. This parameter can be specified multiple times. |
| -n, --name | Unique name of a PLC, which must already be existing in the hardware configuration. Mandatory |
| -C, --certificate | Path to the certificate file that contains public and private keys. Mandatory |
| -p, --password (optional) | Password of the certificate if the certificate is password protected. It is strongly recommended to always protect a certificate's private key . |
| --purpose | The purpose for which the imported certificate should be used (TLS, WebServer, SysLogClient, OpcUaServer). Mandatory |
Return codes
The following return codes are possible:
- 0 - Certificate was imported successfully.
- ≠0 - An error occurred during certificate import.
Important
Before running the import-certificate command, setup-secure-communication command must be executed. This implies existence of a valid security configuration file in the same folder as the hardware declaration.