It seems that the majority of commercially available hardware HSMs are only designed to allow authenticated users to generate, store, and use cryptographic keys with various cryptographic algorithms implemented within the firmware of the HSM.
Reading the datasheets it looks like I can use the provided API to make my (external) application interact with the HSM and use its cryptographic muscles, maybe using keys generated/stored within the HSM. But, it seems that long term storage of the data/objects cryptographically processed by the HSM within the HSM boundary is not available.
Why aren’t there any HSMs that allow for user code and user data to be persistently stored and managed within the physically protected memory space of the HSM?
Does anybody have experience with HSMs and could point me towards a commercially available hardware HSM solution that at the least allows me to store some registers beyond cryptographic keys?
Ideally I would like my application to be stored at rest in the HSM boundary, executed by the same processor that runs the crypto provided by the HSM and to persisytently store a few registers within the HSM's protected area.