Java API
HSM Dinamo
Loading...
Looking for...
No entries found
CreateKeyMaterial.java

Example of creating a key where its value is printed on the screen, without the key persisting in the HSM.

See Note on examples.
package doxy.examples;
import java.util.Arrays;
import com.dinamonetworks.Dinamo;
import br.com.trueaccess.TacException;
import br.com.trueaccess.TacNDJavaLib;
public class CreateKeyMaterial {
static String ipHSM = "127.0.0.1";
static String usr = "master";
static String pass = "12345678";
public static void main(String[] args) throws TacException {
Dinamo api = new Dinamo();
System.out.println("--> Login HSM and create 3DES key");
api.openSession(ipHSM, usr, pass);
byte[] keyMaterial = api.createKeyMaterial(TacNDJavaLib.ALG_3DES_112);
api.closeSession();
System.out.println(Arrays.toString(keyMaterial));
System.out.println("The process ended successfully");
}
}