DINAMO Networks is now aDINAMO cyber security company!
Java API
HSM DINAMO
Loading...
Searching...
No entry found
OpenSessionAnonymous.java

Example of an anonymous session (without authentication) on the HSM, using only the address and port (SS_ANONYMOUS).

See Note on examples.
package doxy.examples;
import com.dinamonetworks.Dinamo;
import br.com.trueaccess.TacException;
import br.com.trueaccess.TacNDJavaLib;
public class OpenSessionAnonymous {
public static void main(String[] args) {
String ip = "127.0.0.1";
Dinamo api = new Dinamo();
try {
api.openSessionAnonymous(ip,
TacNDJavaLib.DEFAULT_PORT,
TacNDJavaLib.ENCRYPTED_CONN);
System.out.println("Anonymous session opened.");
System.out.println("Firmware: " + api.getFirmwareVersion());
} catch (TacException e) {
e.printStackTrace();
} finally {
try { api.closeSession(); } catch (TacException ignore) {}
}
}
}