public void ready(String name, PrivateKey unusedPrivateKey, X509Certificate certificate) { String status; try { vaadin.updateVariable("cert", printBase64Binary(certificate.getEncoded())); status = "Готово."; } catch (CertificateEncodingException e) { status = "Ошибка."; } ui.removeAll(); ui.add(new Label(name), BorderLayout.PAGE_START); ui.add(new Label(status), BorderLayout.CENTER); Button cancel = new Button("Отменить"); cancel.addActionListener( new ActionListener() { @Override public void actionPerformed(ActionEvent e) { loading(); } }); Panel buttons = new Panel(new BorderLayout(2, 2)); buttons.add(cancel, BorderLayout.LINE_START); ui.add(buttons, BorderLayout.PAGE_END); refresh(); }
@Override public void noJcp() { vaadin.updateVariable("state", "noJcp"); ui.removeAll(); ui.add(new Label("КриптоПРО JCP не установлен!"), BorderLayout.LINE_START); refresh(); }
@Override public void loading() { vaadin.updateVariable("state", "loading"); ui.removeAll(); ui.add(new Label("Загрузка сертификатов..."), BorderLayout.LINE_START); Label status = new Label(""); ui.add(status, BorderLayout.CENTER); refresh(); new Thread(new CertDetector(this, ui, status, fio)).start(); }