aws-samples / aws-samples/aws-cloudhsm-jce-examples
No way to specify algorithm for generic secret key
- Dominant language
- Java
- Stars
- 46
- Forks
- 70
- Avg merge
- 52m
- Merged PRs (30d)
- 4
Description
Some libraries like the popular [jjwt](https://github.com/jwtk/jjwt/tree/master) for JSON web tokens assume that, when signing/verifying with `HS256` algorithm, that the `SecretKey#getAlgorithm()` returns `HmacSHA256`
However, loading a generic secret key from CloudHSM `KeyStore` returns a `SecretKey` where `getAlgorithm()` returns `GenericSecret`. Is there a way to supply the "intended use" algorithm for the key somehow?
Contributor guide
Research direction
The issue names no source files, tests, or entry points. Start by locating the CloudHSM KeyStore handling of generic SecretKey instances and the JCE algorithm-selection path, then determine how the intended algorithm should be supplied for the jjwt HS256 scenario and how that behavior could be verified.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- cryptography
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100