Faced the problem of re-initialization of the library .. when you first call everything works fine, but after some time the session between the server and the network HSM is cut and reinitialized cryptoki does not work .. can anyone come across a similar .. how can this be overcome ????

InputStream inputStream = null; ClassPathResource resource = new here ClassPathResource("params.cfg"); inputStream = resource.getInputStream(); SunPKCS11 provider = new SunPKCS11(inputStream); Security.addProvider(provider); 

    0