aws-samples / aws-cloudhsm-jce-examples

Sample applications demonstrating how to use the CloudHSM JCE
MIT No Attribution
37 stars 57 forks source link

Unable find the generated key in AWS cloud HSM #75

Closed konu27 closed 5 months ago

konu27 commented 1 year ago

Ran the following command from the JCE Provider: java -jar key-utility-runner.jar --import-key output: [cloudhsm_provider::hsm1::session::key_management::provider_key_builder::create_key_internal] Key created on the HSM with handle: 655385(0x000A0019)

command: java -jar key-utility-runner.jar --label Test --get-key output: Could not find the given key label Test

unable to find the key from AWS CLI also Command: findKey

    Total number of keys present: 18

    Number of matching keys from start index 0::17

    **Handles of matching keys:
    6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 524305, 524306, 524307, 524308,
    524309, 524310, 524311**

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

    Cfm3FindKey returned: 0x00 : HSM Return: SUCCESS
tstiemerling commented 1 year ago

Is the key a token key (persistent) or session key (transient)? You will only see it if its a token key and it looks like the sample code does not set the token attribute.

rday commented 5 months ago

We don't set the token attribute in our samples to prevent filling up customer HSMs while they are just testing. This is probably the issue, so closing this out. Please re-open if needed!