pki import sm2-key-pair

Function

The pki import sm2-key-pair command imports the SM2 key pair to the device memory.

Format

pki import sm2-key-pair key-name der file-name [ exportable ]

pki import sm2-key-pair key-name pem file-name [ exportable ] [ password password ]

Parameters

Parameter Description Value
key-name Specifies the name of the SM2 key pair to be imported on the device.

The value is a string of 1 to 64 characters and case-sensitive without spaces or question marks (?). If the character string is quoted by double quotation marks (" "), the character string can contain spaces and question marks.

der file-name Specifies the format of the imported SM2 key pair as DER, and specifies the name of the file that stores the SM2 key pair. The value must be an existing SM2 key pair name.
pem file-name Specifies the format of the SM2 key pair to be imported as PEM, and specifies the name of the file that stores the SM2 key pair. The value must be an existing SM2 key pair name.
exportable Specifies the imported SM2 key pair as exportable. -
password password Specifies the decryption password of the SM2 key pair. The decryption password is the same as the password set by the pki export sm2-key-pair command. The value must be the existing decryption password of the SM2 key pair.

Views

System view

Default Level

3: Management level

Usage Guidelines

Usage Scenario

Run this command to use the SM2 key pairs generated by other entities.

Prerequisites

The RSA key pair must already exist on the storage device.

Precautions

Before importing a certificate or key pair, ensure that the certificate or key pair is stored in the specified directory (public directory on the root system). For example, the certificate or key pair is in the public directory of the root system:
<sysname> cd pki
<sysname> cd public/

Example

Import the SM2 key pair "aaa.pem" in the PEM format. The SM2 key pair is named key-1 in the system with the decryption password Admin@1234, and is marked exportable.

<sysname> system-view
[sysname] pki import sm2-key-pair key-1 pem aaa.pem exportable password Admin@1234 
 Info: Succeeded in importing SM2 key pair in PEM format.
Related Topics
display pki credential-storage-path

Copyright © Huawei Technologies Co., Ltd.