API Java
HSM Dinamo
Carregando...
Procurando...
Nenhuma entrada encontrado
SPBImportCertificate.java

Exemplo de importação de certificado SPB.

Veja Nota sobre os exemplos.
package doxy.examples;
import java.io.FileInputStream;
import com.dinamonetworks.Dinamo;
import br.com.trueaccess.TacException;
public class SPBImportCertificate {
private static String strAddr = "127.0.0.1";
private static String strUsrId = "master";
private static String strPwd = "12345678";
private static int nPort = 4433;
private static String szDomain = "SPR";
public static void main(String[] args) {
int nFlags = 0;
Dinamo api = new Dinamo();
try {
api.openSession(strAddr, strUsrId, strPwd, nPort, nFlags);
FileInputStream fis = new FileInputStream("ABC.cer");
byte[] buffer = new byte[(int) fis.getChannel().size()];
fis.read(buffer);
fis.close();
api.SPBImportCertificate(szDomain, buffer);
api.closeSession();
} catch (TacException e) {
e.printStackTrace();
} catch (Exception e) {
e.printStackTrace();
}
}
}