AWS CloudHSM Private Key retrieval

96 views Asked by At

I'm trying to retrieve private key from AWS Cloud HSM using PKCS11 Client SDK 5. There's no issue with the connection, but I'm getting an empty list.

Steps taken:

  • I have used the following command to produce an ECC key pair:

    key generate-asymmetric-pair ec \
      --curve secp256r1 \
      --public-label mylabel \
      --private-label mylabel
    
  • Using PKCS11 Client SDK5

  • Logged in to HSM as Crypto User

  • Opened a Session

  • When fetching the private key using this command:

    private_key = session.findObjects([(CKA_LABEL , key_label),(CKA_CLASS , CKO_PRIVATE_KEY)])[0]
    

    The private key retrieval attempt returns '[]', indicating that there is nothing in the list.

What am I missing here?

0

There are 0 answers