Example of the key/certificate pair configuration used by the HSM when establishing the TLS tunnel.
- See Note on examples.
package doxy.examples;
import com.dinamonetworks.Dinamo;
import br.com.trueaccess.TacException;
import br.com.trueaccess.TacNDJavaLib;
public class SetTlsBundle {
public static void main(String[] args) {
String ip = "127.0.0.1";
String user = "master";
String pwd = "12345678";
String tlsKeyId = "tls_key";
String tlsCertId = "tls_cert";
Dinamo api = new Dinamo();
try {
api.openSession(ip, user, pwd, TacNDJavaLib.DEFAULT_PORT,
TacNDJavaLib.ENCRYPTED_CONN);
api.setTlsBundle(tlsKeyId, tlsCertId);
System.out.println("TLS bundle updated successfully.");
api.setTlsBundle("", "");
System.out.println("TLS bundle reset to default.");
} catch (TacException e) {
e.printStackTrace();
} finally {
try { api.closeSession(); } catch (TacException ignore) {}
}
}
}