This section describes how to use the KMC encryption algorithm to generate the CA key and KMC key file. The following uses certImport.sh as an example to describe how to use CertImport (a C++ executable program) in the ${MX_SDK_HOME}/bin directory to verify and import a certificate, and generate and write a key.
1 | $ bash ./certImport.sh -h |
1 2 3 4 5 | ├── InferConfigRepository │ ├── ... ├── run.sh // StreamServer startup script ├── certImport.sh // Script for importing and encrypting the certificate ├── ... |
Execute KMC-related encryption algorithms, including certificate verification, KMC encryption, and configuration file writing. The following is a command example.
$ bash ./certImport.sh -c <ca.crt_path> -s <server.crt_path> -k <server.key_path>
<ca.crt_path> indicates the path of the CA certificate, <server.crt_path> indicates the path of the server certificate, and <server.key_path> indicates the path of the server certificate key. These parameters are input by adding -c, -s, and -k, respectively.
This script is used to import certificate and key files. During the script execution, you need to enter the password of the server certificate. The password can contain a maximum of 100 characters.
The command output is as follows:
$ bash ./certImport.sh -c <ca.crt_path> -s <server.crt_path> -k <server.key_path> -r <crl_path>
<ca.crt_path> indicates the CA certificate path, <server.crt_path> indicates the server certificate path, <server.key_path> indicates the server certificate key path, and <crl_path> indicates the CRL path. Input them by adding -c, -s, -k, and -r, respectively.
This script is used to import certificates, keys, and CRLs. During the script execution, you need to enter the server certificate password which cannot exceed 100 characters.
1 2 3 4 5 6 7 8 9 10 11 12 | ├── InferConfigRepository │ ├── ... ├── keys │ ├── ca.crt // CA certificate │ ├── server.crt // Server certificate │ ├── server.key // Server key │ ├── ca.crl // CA CRL (optional) │ ├── kmc.ks // KMC master key │ ├── StandbyKsf.ks // KMC backup key ├── run.sh // StreamServer startup script ├── certImport.sh // Script for importing and encrypting the certificate ├── ... |
During service running, if the certificate, private key, or CRL needs to be updated or replaced due to such reasons as certificate expiration, the owner of the current certificate and other files needs to perform the following steps in sequence:
During the update and replacement, requests sent to the inference service may be abnormal due to the lack of related certificate, private key, or CRL files.
After the update is complete, delete the replaced certificate, private key, and CRL files in a timely manner to prevent information leakage.