Finding a Key
Configure command for finding key.
The findKey
command enables you to find all keys that matches a specified key class, key label, and modulus.
Open a command prompt and run findKey
command to find all keys that matches a specified key class, a key label, and a modulus.
Command
Syntax: findKey -h [-c <key class>] [-t <key type>]
[-l <key label>] [-id <key ID>]
[-sess 0/1]
Where,
Parameter | Description |
---|---|
-h | Displays this information |
-c | specifies the Key Label, if label contains spaces it should be written in between " characters. 2 = public 3 = private 4 = secret |
-t | Specifies the key type to find (optional) 0 = RSA 1 = DSA 3 = EC 16 = GENERIC_SECRET 19 = DES 21 = DES3 31 = AES |
-l | Specifies the key label to find (optional), if label contains spaces it should be written in between " characters. |
-id | Specifies key ID (optional) |
-sess | Specifies option to find only session keys(1) or only token keys(0) (optional) . |
Example
Command: findKey
Total number of keys present 10
number of keys matched from start index 0::9
262151, 262152, 262153, 262154, 262155, 262156, 262157, 262158, 262159, 262160
PKCS #11 FindKey returned: 0x00 : HSM Return: SUCCESS
----------------------------------------------------------------------------
Command: findKey -l kms
Key count request cluster status:
Cluster Status:
Node id 0 status: 0x00000000 : HSM Return: SUCCESS
Node id 1 status: 0x00000000 : HSM Return: SUCCESS
Node id 2 status: 0x00000000 : HSM Return: SUCCESS
Total number of keys present: 1
Number of matching keys from start index 0::0
Handles of matching keys:
524667
Cluster Status:
Node id 0 status: 0x00000000 : HSM Return: SUCCESS
Node id 1 status: 0x00000000 : HSM Return: SUCCESS
Node id 2 status: 0x00000000 : HSM Return: SUCCESS
KeyMgmtUtilsFindKey returned: 0x00 : HSM Return: SUCCESS