nl.nikhef.slcshttps
Interface PKCS12Https.PKCS12Communicator

All Known Implementing Classes:
PKCS12Https.StdioComm, PKCS12PopupComm
Enclosing class:
PKCS12Https

public static interface PKCS12Https.PKCS12Communicator

Interface for PKCS12Https communication with the user.

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

Method Summary
 void error(String filename, Exception e)
          called when an error occurs.
 String getFile(String path)
          method to get the PKCS12 filename from the user.
 char[] getPassword(String prompt)
          method to get the PKCS12 password from the user.
 void success(String filename, String subject)
          called when the PKCS12 file is successfully imported and the certificate stored.
 

Method Detail

getPassword

char[] getPassword(String prompt)
                   throws IOException
method to get the PKCS12 password from the user.

Parameters:
prompt - String to print before input.
Returns:
char[] representation of the password
Throws:
IOException - upon I/O error

getFile

String getFile(String path)
               throws IOException
method to get the PKCS12 filename from the user.

Parameters:
path - String path to start in, use as offset.
Returns:
String representation of the absolute filename.
Throws:
IOException - upon I/O error

error

void error(String filename,
           Exception e)
           throws IOException
called when an error occurs. It prints an error string using the filename and e.g. the Throwable.getMessage() from e.

Parameters:
filename - String describing the PKCS12 filename which was tried (if any).
e - Exception that caused the error (if any).
Throws:
IOException - with a (new) description of the problem

success

void success(String filename,
             String subject)
called when the PKCS12 file is successfully imported and the certificate stored. It is supposed to make use of PKCS12Https.getShowSuccess() to decide whether to show anything.

Parameters:
filename - String describing the PKCS12 filename which was imported.
subject - String describing the Subject DN of the certificate.


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