Possible to create new virtual server through api with pre-hashed password.

I have a user script that I’m developing a virtualmin management interface for. I’d like to create virtual-servers using passwords that are already stored in my user script as md5 hashes. I know I can create mail/ftp users this way but I was curious as to creating the virtual server with that password also.

IE customer signs up wants to purchase hosting/purchases the hosting package I can then migrate the md5 password and username from the database to the remote api call to create a virtual server. Otherwise I would need to request a password from my user before creating the account but it seems somewhat in bad form and not as integrated as I would like.

something like this virtualmin create-domain --domain something.tld --pass md5 hash here --user username from script --plan “Business”

Is this possible in some way? or would I need to change my user script to use some sort of encryption system so that it can decrypt their password to do the creation? IE have open_ssl encrypted password’s stored in the db and on create simply un-encrypt that value to place in the --pass command switch.

This second method worries me somewhat as it is much more prone to insecurity than simply importing a pre-exististing md5 because now it is susceptible to an attack if somebody we’re to gain db access they might be able to decrypt the password and gain access to my user accounts.

Meh abandoned this theirs a few ways to go about it but… upon further inspection I’m not comfortable doing that as it could expose things so instead I’ll generate a random password and just E-mail it to new clients. With instructions on how to change it to something better. Since I favor random mysql passwords anyway that are different from the virtual server password for obvious reasons. API rocks though got my list-users/list-domains function running from an ajax call although I have to call it twice =_= once to get the names and then a second time to pull them individually so that I can do pagination. But the first call isn’t heavy so no worries.