We have 2 Java processes each using IAIK (iaik.pkcs.pkcs11
)to talk to a shared single token NSS/HSM/smartcard.
Each of these Java processes creates the IAIK session and logs in:
session = token.openSession(Token.SessionType.SERIAL_SESSION,
Token.SessionReadWriteBehavior.RW_SESSION, null, null);
session.login(Session.UserType.USER, XXXX);
We were expecting that when a Java process updates the token (for example: adds the certificate, keys), the other java process would be able to see the changes as well( for example: session.findObjectsInit(certTemplate)
would find the certificate that was added by another Java process).
Unfortunately, that doesn't seem to be the case. Once the session is opened and logged in, it seems to have captured the information of the token at the time.
Is there a way to get update/refresh the IAIK session?