nl.nikhef.slcshttps.gui
Class PKCS12PopupComm

java.lang.Object
  extended by nl.nikhef.slcshttps.gui.PKCS12PopupComm
All Implemented Interfaces:
PKCS12Https.PKCS12Communicator

public class PKCS12PopupComm
extends Object
implements PKCS12Https.PKCS12Communicator

Implementation of PKCS12Https.PKCS12Communicator using popup windows.

Version:
0.1
Author:
Mischa Sallé
See Also:
PKCS12Https.PKCS12Communicator

Constructor Summary
PKCS12PopupComm()
           
 
Method Summary
 void error(String fileName, Exception e)
          Called when an error occurs, showing a popup window with an error string about the filename (if non-null) and the Throwable.getMessage() from e (when non-null).
 String getFile(String path)
          Method to get the PKCS12 filename from the user, using a popup.
 char[] getPassword(String prompt)
          Method to get the PKCS12 password from the user, using a popup.
 void success(String fileName, String subject)
          Called when the PKCS12 file is successfully imported and the certificate stored; when PKCS12Https.getShowSuccess() equals true it will show a confirmation popup.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PKCS12PopupComm

public PKCS12PopupComm()
Method Detail

getPassword

public char[] getPassword(String prompt)
Method to get the PKCS12 password from the user, using a popup.

Specified by:
getPassword in interface PKCS12Https.PKCS12Communicator
Parameters:
prompt - String to print before input.
Returns:
char[] representation of the password
Throws:
IOException - upon I/O error
See Also:
PasswordPopup

getFile

public String getFile(String path)
               throws IOException
Method to get the PKCS12 filename from the user, using a popup. If path is non-null it it used to start the file popup in, otherwise the user default directory is used.

Specified by:
getFile in interface PKCS12Https.PKCS12Communicator
Parameters:
path - String path to start in, use as offset.
Returns:
String representation of the absolute filename.
Throws:
IOException - upon I/O error (including unreadability).
See Also:
FilePopup

error

public void error(String fileName,
                  Exception e)
           throws IOException
Called when an error occurs, showing a popup window with an error string about the filename (if non-null) and the Throwable.getMessage() from e (when non-null).

Specified by:
error in interface PKCS12Https.PKCS12Communicator
Parameters:
fileName - String describing the PKCS12 filename which was tried.
e - Exception that caused the error (if any).
Throws:
IOException - with a (new) description of the problem
See Also:
GraphTools.errorPopup(String,Exception)

success

public void success(String fileName,
                    String subject)
Called when the PKCS12 file is successfully imported and the certificate stored; when PKCS12Https.getShowSuccess() equals true it will show a confirmation popup.

Specified by:
success in interface PKCS12Https.PKCS12Communicator
Parameters:
fileName - String describing the PKCS12 filename which was imported.
subject - String describing the Subject DN of the certificate.
See Also:
GraphTools.successPopup(String)


nl.nikhef.slcshttps Mischa Sallé - msalle(AT)nikhef.nl