Hi,
The certificates and private key file in DER or PEM format are separated. When they are imported, only the file name extension is different and other parameters are the same. If the CA provides two CA certificates rootca.pem and middleca.pem, local certificate localcert.pem, and private key file local_privatekey.pem in PEM format, and they need to be imported to the PKI domain named test, perform the following procedures:
1. Import CA certificates one by one. You can run the display pki certificate ca realm test command to view the imported certificates.
[HUAWEI] pki import-certificate ca realm test pem filename rootca.pem
[HUAWEI] pki import-certificate ca realm test pem filename middleca.pem
2. Import the local certificate. You can run the display pki certificate local realm test command to view the imported certificate.
[HUAWEI] pki import-certificate local realm test pem filename localcert.pem
3. Import the private key file. If the CA provides a private key file, import the private key file. Otherwise, skip this step and assume that the password is set to Admin@123. You can run the display pki rsa local-key-pair name test public command to view the imported file.
[HUAWEI] pki import rsa-key-pair test pem local_privatekey.pem password Admin@123
4. Check whether the imported certificate matches the private key. If no matching key pair is found, check whether the imported file is correct.
[HUAWEI] pki match-rsa-key certificate-filename localcert.pem
Info: The file localcert.pem contains certificates 1.
Info: Certificate 1 from file localcert.pem matches RSA key test.
The certificates and private key file in PKCS12 format are in the same file. If the CA provides two CA certificates rootca.pem and middleca.pem, local certificate, and private key file localcert.p12 in PKCS12 format, and they need to be imported to the PKI domain named test, perform the following procedures:
1. Import CA certificates one by one. You can run the display pki certificate ca realm test command to view the imported certificates.
[HUAWEI] pki import-certificate ca realm test pem filename rootca.pem
[HUAWEI] pki import-certificate ca realm test pem filename middleca.pem
2. Import the local certificate. You can run the display pki certificate local realm test command to view the imported certificate.
[HUAWEI] pki import-certificate local realm test pkcs12 filename localcert.p12
3. Import the private key file. If the CA provides a private key file, import the private key file. Otherwise, skip this step and assume that the password is set to Admin@123. You can run the display pki rsa local-key-pair name test public command to view the imported file.
[HUAWEI] pki import rsa-key-pair test pkcs12 localcert.p12 password Admin@123
4. Check whether the imported certificate matches the private key. If no matching key pair is found, check whether the imported file is correct.
[HUAWEI] pki match-rsa-key certificate-filename localcert_local.cer
Info: The file localcert_local.cer contains certificates 1.
Info: Certificate 1 from file localcert_local.cer matches RSA key test.