Import or Export symmetric keys to/from HSM

Hi there,
I have a hybrid setup where some symetric keys have to be in a Keepass database and in an HSM. Therefore I would like to be able to export HSM-generated keys to a Keepass database, or the other way round. I understand that importing clear keys to the HSM is not possible (and not a good idea), so are there other ways for me to do what I want?

Thank you

Do you want to use the symmetric keys in Keepass or do you just want to keep a backup ?

You can always decode DKEK wrapped keys when exported from the device, given that you have the DKEK shares. See the DKEK class in scsh/sc-hsm of the Smart Card Shell installation.

Hello,
I would like to use the symmetric keys in Keepass (or a cloud HSM for that matter) and in the HSM.
Do you have some kind of documentation to setup a DKEK so that it can be decrypted outside of the HSM?
Thank you