gen_cert

Description

Generates certificates, keys, and password files offline based on the configuration file.

Syntax

./bin/gen_cert configFile ip

Parameters

Parameter

Description

configFile

Path of the gen_cert.json file.

ip

IP address of a certificate. If no certificate is set, use None.

An example of the gen_cert.json file:

{
    "ca_cert": "/path/to/ca.pem",                         # Path of the CA certificate
    "ca_key": "/path/to/ca.key.pem",                      # Key file path of the CA certificate
    "ca_key_pwd": "/path/to/ca_passwd.txt",               # Key password file path of the CA certificate
    "cert_config": "/path/to/cert_config.json",           # Path of the certificate configuration file
    "output_path": "/path/to/output_dir",                 # Directory for storing generated files
    "kmc_ksf_master": "/path/to/tools/pmt/master/ksfa",   # KMC master file used for encryption and decryption
    "kmc_ksf_standby": "/path/to/tools/pmt/standby/ksfb"  # KMC standby file used for encryption and decryption
}

An example of the cert_config.json file:

{
    "subject": "subject_name",      # Certificate subject name
    "expired_time": 365,            # Certificate validity period (days)
    "serial_number": 123,           # Certificate serial number
    "req_distinguished_name": {     # Organization to which the certificate belongs
        "C": "CN",                  # Country
        "ST": "Sichuan",            # Province
        "L": "Chengdu",             # City
        "O": "Huawei",              # Company
        "OU": "Ascend",             # Department
        "CN": "MindIE"              # Organization
    },
    "alt_names": {                  # Alias
        "IP": [],                   # IP address
        "DNS": []                   # Domain name
    }
}