- Newest
- Most votes
- Most comments
To refer to a CloudHSM key when using OpenSSL, you need to use the CloudHSM dynamic engine for OpenSSL. Your command is on the right track, but let's clarify a few points:
-
The
-engine cloudhsmoption is correct. This tells OpenSSL to use the CloudHSM dynamic engine. -
For the
-keyoption, you're close, but the format needs a slight adjustment. Instead of "cloudhsm:handle=1", you should use the format "handle:key_handle". For example: "-key handle:1".
The key handle is a unique identifier for your key in the HSM. You'll need to know this handle beforehand. Unfortunately, the OpenSSL command itself doesn't provide a way to list or find key handles.
To find the key handle, you would typically use the CloudHSM management utilities or APIs. For instance, you might use the CloudHSM CLI to list keys and their handles.
It's worth noting that while OpenSSL with the CloudHSM engine is powerful, it may not be the most straightforward method for generating a CSR. An alternative approach could be to use the keytool utility with the AWS CloudHSM keystore, which provides a more integrated experience with CloudHSM.
If you decide to stick with OpenSSL, make sure you have properly set up the CloudHSM client and configured the OpenSSL dynamic engine before running your command. The shared library for the dynamic engine should be located at /opt/cloudhsm/lib/libcloudhsm_openssl.so on your system.
Sources
Use the OpenSSL Dynamic Engine for AWS CloudHSM Client SDK 3 - AWS CloudHSM
Generate an AWS CloudHSM CSR using keytool - AWS CloudHSM
answered 2 years ago
Relevant content
asked 2 years ago
asked 2 years ago
asked 2 years ago
