Ejemplo de creación de un nuevo usuario y uso de ACL.
- Véase la nota sobre ejemplos.
package doxy.examples;
import com.dinamonetworks.Dinamo;
import br.com.trueaccess.TacException;
import br.com.trueaccess.TacNDJavaLib;
public class CreateUser {
static String ipHSM = "127.0.0.1";
static String usr_admin = "master";
static String password_admin = "12345678";
static String usr_login = "usrapi01";
static String password_usr = "12345678";
public static void main(String[] args) throws TacException {
Dinamo api = new Dinamo();
System.out.println("--> Operator login and create a new user with ACL_SYS_BACKUP + ACL_USR_LIST");
api.openSession(ipHSM, usr_admin, password_admin);
api.createUser(usr_login, password_usr, TacNDJavaLib.ACL_SYS_BACKUP | TacNDJavaLib.ACL_USR_LIST);
api.closeSession();
System.out.println("--> Remove the user created");
api.openSession(ipHSM, usr_admin, password_admin);
api.deleteUser(usr_login);
api.closeSession();
System.out.println("The process ended sucessfully");
}
}