The ViCredStore package includes the following subroutines:
■
■ Initializes the credential store. Call this subroutine once, before any of the other credential store subroutines. The credential store is not created until your program calls add_password.This subroutine accepts the location of the credential store file. If you do not provide a credential store filename VICredStore::init() looks in the default location.
■ Linux: $HOME/.vmware/credstore/vicredentials.xml
■ Windows: %APPDATA%\VMware\credstore\vicredentials.xml
■ Checks that the credstore directory exists, and creates one if it does not.
■ Creates the vicredentials.xml file and parent directory.If you provide a non-default credential store filename to VICredStore::init(), the credential store at that location is used. If there is no credential store at that location and the directory you specify exists, the initialization process creates the file. If the directory you specify does not exist, the initialization process fails.
Server for which you want to retrieve the password for the specified user. Can be an ESX/ESXi or vCenter Server system. Returns the password, or undef if no password is found.If a password already exists for that server and user name, add_password overwrites that password.
User name for the new entry. VMware recommends that you create a user with appropriate privileges and store the corresponding user name and password in the credential store. Do not use the root or administrator user and the corresponding password.
Server from which the password for the specified user is removed. Can be an ESX/ESXi or vCenter Server system. server – Server for which all user names are listed.Closes the credential store, and frees all resources associated with it. If you want to run additional credential store subroutines, you must run init again to reinitialize the credential store.