Filesytem mount when login/umount on logout

I want to have “non persistent veracrypt volumes” to store user’s nextcloud files

for this I want the user to be able to send a password and keyfiles used to uncrypt and mount the volume

is there any module that can used?

the process could be a 2 steps process : first login to nextclound, then mount the crypted volume

or single step : have nextcloud login page allow to add keyfiles

on logout the file system have to be unmounted

is it possible? I don’t want the files to be on “permanently mounted filesystems” for security (if the server get attacked) and because as long as the power is kept, a physical intruder can do whatever he likes

I also want to rely on real filesystems because files have to accessible by other ways (ssh…)

thanks and regards