private void login(final Session session) throws P11TokenException { boolean isSessionLoggedIn = checkSessionLoggedIn(session); if (isSessionLoggedIn) { return; } boolean loginRequired; try { loginRequired = session.getToken().getTokenInfo().isLoginRequired(); } catch (TokenException ex) { LogUtil.error(LOG, ex, "could not check whether LoginRequired of token"); loginRequired = true; } LOG.debug("loginRequired: {}", loginRequired); if (!loginRequired) { return; } if (CollectionUtil.isEmpty(password)) { singleLogin(session, null); } else { for (char[] singlePwd : password) { singleLogin(session, singlePwd); } } }
private void login(Session session) throws P11TokenException { boolean isSessionLoggedIn = checkSessionLoggedIn(session); if (isSessionLoggedIn) { return; } boolean loginRequired; try { loginRequired = session.getToken().getTokenInfo().isLoginRequired(); } catch (TokenException ex) { LogUtil.error(LOG, ex, "could not check whether LoginRequired of token"); loginRequired = true; } LOG.debug("loginRequired: {}", loginRequired); if (!loginRequired) { return; } if (CollectionUtil.isEmpty(password)) { singleLogin(session, null); } else { for (char[] singlePwd : password) { singleLogin(session, singlePwd); } } }
private void firstLogin(Session session, List<char[]> password) throws P11TokenException { try { boolean isProtectedAuthenticationPath = session.getToken().getTokenInfo().isProtectedAuthenticationPath(); if (isProtectedAuthenticationPath || CollectionUtil.isEmpty(password)) { LOG.info("verify on PKCS11Module with PROTECTED_AUTHENTICATION_PATH"); singleLogin(session, null); } else { LOG.info("verify on PKCS11Module with PIN"); for (char[] singlePwd : password) { singleLogin(session, singlePwd); } this.password = password; } } catch (PKCS11Exception ex) { // 0x100: user already logged in if (ex.getErrorCode() != 0x100) { throw new P11TokenException(ex.getMessage(), ex); } } catch (TokenException ex) { throw new P11TokenException(ex.getMessage(), ex); } }
private void firstLogin(final Session session, final List<char[]> password) throws P11TokenException { try { boolean isProtectedAuthenticationPath = session.getToken().getTokenInfo().isProtectedAuthenticationPath(); if (isProtectedAuthenticationPath || CollectionUtil.isEmpty(password)) { LOG.info("verify on PKCS11Module with PROTECTED_AUTHENTICATION_PATH"); singleLogin(session, null); } else { LOG.info("verify on PKCS11Module with PIN"); for (char[] singlePwd : password) { singleLogin(session, singlePwd); } this.password = password; } } catch (PKCS11Exception ex) { // 0x100: user already logged in if (ex.getErrorCode() != 0x100) { throw new P11TokenException(ex.getMessage(), ex); } } catch (TokenException ex) { throw new P11TokenException(ex.getMessage(), ex); } }
maxSessionCount2 = token.getTokenInfo().getMaxSessionCount(); } catch (TokenException ex) { throw new P11TokenException("could not get tokenInfo: " + ex.getMessage(), ex);
maxSessionCount2 = token.getTokenInfo().getMaxSessionCount(); } catch (TokenException ex) { throw new P11TokenException("could not get tokenInfo: " + ex.getMessage(), ex);