Currently, it is possible to create two crypto tokens referring to the same slot on the HSM. This can cause all sorts of problems, e.g.
- Problem with caching, if one key is created in one crypto token it does not always show up in the other crypto token
- Customer confusion, where the customer thinks "why do I have this signKey here, let's delete it click"
- The wrong provider is being used and you get "Private key must be instance of RSAPrivate(Crt)Key or have PKCS#8 encoding" (not confirmed, Anton and I could not reproduce).
When creating a new crypto token, if another crypto token is already referring to the same slot, an error message should be shown in the UI.