How can I change user’s key pair generated by owncloud and integrate my own keys

I understand nextcloud genenrate some key pair for a single user in order to encryp files, however we need to use some previously generated key pair instead. How could we substitute the ones that owncloud created by the ones we already have?. This requeriment is neccesary in order to have a unique key pair for many services(these services are working on now).

Thank you in advance.

I think there is no official way to import existing keys. You can probably create a new user, let NC create the keys (make sure there are no encrypted files in the user’s storage), switch on maintenance mode and change the keys to the old ones. The user password should be the same because the keys are secured with the user’s password. Not sure if it still works properly, you probably want to move files to the new setup as well and encryption signs the files with content from the filecache-table. So it would be probably better to migrate your old setup to NC.

@bjoern