All Products
Search
Document Center

Key Management Service:findAllKeys

Last Updated:Mar 31, 2026

Use findAllKeys to list all exclusive and shared keys associated with a cryptographic user (CU) on an HSM. Only administrators (CO) and audit users (AU) can run this command.

Important

Start hsm_mgmt_tool and log in to the HSM with an authorized user type before running this command.

Prerequisites

Before you begin, ensure that you have:

  • Started hsm_mgmt_tool and logged in as an administrator (CO) or audit user (AU)

  • The user ID of the CU whose keys you want to list (run listUsers if you don't have it)

User types

The following user types can run this command. For details, see HSM user permissions table.

  • Administrator (CO)

  • Audit user (AU)

Cryptographic users (CU) cannot run findAllKeys. Note that findAllKeys returns only the public keys owned by the current CU, whereas findKey in key_mgmt_tool retrieves all public keys, including those not owned by the current CU. A CU can get equivalent information by:
Running listUsers to identify all users
Running findKey in hsm_mgmt_tool to locate usable keys
Running getKeyInfo in hsm_mgmt_tool to determine key ownership and sharing

Syntax

findAllKeys <user id> <key hash (0/1)> [<output file>]
Important

Enter parameters in the order shown in the syntax.

In the output, exclusive keys are marked with (o) and shared keys with (s).

Parameters

ParameterDescriptionRequiredValid values
<user id>The user ID for finding keys.YesNo special requirements
<key hash (0/1)>Whether to hide the key hash value.Yes0: Hide; 1: Show
[<output file>]The name of the file to save the output to.OptionalAny valid file name

Examples

List keys for a user (hash hidden)

This example lists exclusive and shared keys for user 3, with the key hash hidden.

cloudmgmt>findAllKeys 3 0
Keys on server 0(172.16.0.2):
Number of keys found 1
number of keys matched from start index 0::1
6(o)
findAllKeys success on server 0(172.16.0.2)

Output explanation:

  • Number of keys found 1 — one key is associated with user 3

  • number of keys matched from start index 0::1 — one key matched, starting from index 0

  • 6(o) — key with handle 6, marked (o) to indicate it is exclusively owned by user 3

What's next

  • findKey — search for keys by attribute in key_mgmt_tool

  • listUsers — list all users on the HSM

  • getKeyInfo — get ownership and sharing details for a specific key