aws-samples / aws-samples/aws-cloudhsm-jce-examples
Example for KeyAttributes/Properties
- Dominant language
- Java
- Stars
- 46
- Forks
- 70
- Avg merge
- 52m
- Merged PRs (30d)
- 4
Description
Hi,
We are trying to migrate from CloudHSM Client v3.x to v5.x and we were using the CaviumKey to get all the key properties like
key.isPersistent()
key.isExtractable()
key.getAlgorithm()
key.getSize()
key.getLabel()
The KeyUtilitiesRunner.java in master has the below implementation.
```
private static void displayKeyInfo(CaviumKey key) {
if (null != key) {
System.out.printf("Key handle %d with label %s\n", key.getHandle(), key.getLabel());
// Display whether the key can be extracted from the HSM.
System.out.println("Is Key Extractable? : " + key.isExtractable());
// Display whether this key is a token key.
System.out.println("Is Key Persistent? : " + key.isPersistent());
// The algorithm and size used to generate this key.
System.out.println("Key Algo : " + key.getAlgorithm());
System.out.println("Key Size : " + key.getSize());
}
}
```
Can you please provide a similar sample for SDK5
Thanks
Narasimha
Contributor guide
Research direction
Start with KeyUtilitiesRunner.java and inspect its displayKeyInfo method and the existing CaviumKey property calls. Compare those calls with the SDK 5 APIs, then update the sample so it demonstrates equivalent key properties and can be run as an SDK 5 example.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- documentation
- Issue type
- Documentation
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100