All Products
Search
Document Center

Key Management Service:importPubKey

Last Updated:Mar 31, 2026

Imports a public key from a file into an HSM (Hardware Security Module).

Prerequisites

Before you run this command, start key_mgmt_tool and log on to the HSM as a CU (Crypto User).

Overview

importPubKey loads a public key from a local file into the HSM. Use it with exportPubKey to back up or migrate public keys.

Syntax

Important

Parameters must be entered in the order shown below.

importPubKey -l <label>
             -f <key-file>
             [-sess]
             [-id <key-id>]
             [-min_srv <minimum-number-of-servers>]
             [-timeout <number-of-seconds>]

Parameters

ParameterDescriptionRequired
-lThe label for the imported key.Yes
-fThe name of the file that contains the key to import.Yes
-sessMarks the imported key as a session key.No
-idThe ID to assign to the imported key.No
-min_srvThe minimum number of HSM servers that the key must synchronize to within the timeout period. If synchronization does not complete within the timeout, the key is not created.No
-timeoutThe number of seconds to wait for synchronization to the number of servers specified by -min_srv. Use only with -min_srv. Default: no timeout (waits indefinitely until the key is synchronized to the minimum number of servers).No

Example

The following example imports publickey.pem and assigns the label importedPublicKey to the key. The output shows that the imported public key was assigned handle 18 in the HSM.

Command:  importPubKey -l importedPublicKey -f publickey.pem

          Cfm3CreatePublicKey returned: 0x00 : HSM Return: SUCCESS

Public Key Handle: 18

          Cluster Status:
          Node id 0 status: 0x00000000 : HSM Return: SUCCESS