public void PasswdCardInserted(CardActionEvents ce) {
		System.out.println("Inserted passwd manager card.");
		long timeElapsed = 0;
		try {
			BasicService service = ce.getService();
			service.open();
			Reader reader = new Reader();
			if (service != null) {
				PasswdEnterDialog passwd = new PasswdEnterDialog(reader, "Passwd Manager Reader");
				timeElapsed = System.currentTimeMillis();
				byte[] s = passwd.getBACString();
				service.addAPDUListener(reader);
				if (s != null) {
					service.doBAC(s);
				}
				reader.setVisible(true);
				if (s != null) {
					reader.getStatusBar().setBACOK();
				} else {
					reader.getStatusBar().setBACNotChecked();
				}
				reader.setPasswdManager(new PasswdManager(service));
				if (reader.getPasswdManager().hasEAC()) {
					if (reader.getPasswdManager().wasEACPerformed()) {
						reader.getStatusBar().setEACOK();
					} else {
						reader.getStatusBar().setEACFail("TODO get reason");
					}
				} else {
					reader.getStatusBar().setEACNotChecked();
				}
				// Make the frame visible only after a successful BAC
				if (reader.getCOMFile() == null) {
					InputStream in = reader.getPasswdManager()
							.getInputStream(BasicService.EF_COM);
					reader.setCOMFile(new DG_COM(in));
					reader.readData();
					reader.verifySecurity(service);
				}
				timeElapsed = System.currentTimeMillis() - timeElapsed;
				System.out.println("Reading time: " + (timeElapsed / 1000) + " s.");
			}
		} catch (Exception e) {
			e.printStackTrace();
		}

	}