All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class semper.certificate.CertificateBrowserApp

java.lang.Object
   |
   +----semper.util.browser.Browser
           |
           +----semper.certificate.CertificateBrowserApp

public class CertificateBrowserApp
extends Browser
implements BrowseableActions

Variable Index

 o ACTIONS
 o NUMBER_OF_KEYS

Constructor Index

 o CertificateBrowserApp()
Empty constructor.
 o CertificateBrowserApp(CertBag, CertBag, ModuleInformation)
Constructs the CertificateBrowserApp for the user 's certificates and the received ones, taking into account the existing initialised modules.

Method Index

 o certificateBrowser()
Interacts with the user via a TINGUIN session.
 o certificatePolicy(CertBag, TinguinSession)
The user has chosen which certificates he wants to browse.
 o compareTo(Browseable, Browseable, int, boolean)
Compare with given object.
 o exportToFile(Certificate)
Exports a certificate object to a file with extension *.crt, as well as the corresponding private key to a file with extension *.key.
 o getActions()
Sets the names of the actions that should be displayed on the TINGUIN.This method is dynamically invoked by the method interact2 of the Browser class.
 o getCertificates(CertBag, TinguinSession)
Retrieves the certificates and creates the table containing the browseable objects.
 o getKeys()
Obtain the names of the keys which can be used to sort.
 o getMethodName(int)
Finds the name of the method that for the selected action.
 o getNewPolicy(TinguinSession, boolean, CertBag, int, Certificate, String)
Changes an already stored policy or adds a new one to the selected certificate.
 o importFromFile(CertBag, TinguinSession)
Imports a certificate object from a file (*.crt), as well as the corresponding private key from a file with extension *.key.
 o launch()
Implements the MenuLaunchable interface.
 o policyList(CertBag, TinguinSession)
Lists all the policies found in certificate bag.
 o remove(Certificate)
Removes a certificate of the archive and the CertBag, that stores it.
 o removePolicy(TinguinSession, CertBag, Situation, Certificate)
Removes an already stored policy of the selected certificate.
 o verify(Certificate)
Verifies the correctness of the selected certificate (ie whether signature matches its contents).
 o viewFingerprints(Certificate)
Displays the fingerprint of the certificate 's public key, as well as the fingerprint of the CA 's public key.
 o viewPolicy(Certificate)
Displays the policy for a selected certificate.
 o viewPolicyCertificates(CertBag, int, TinguinSession)
Lists all the certificates that can be used with the selected policy.

Variables

 o NUMBER_OF_KEYS
 protected static int NUMBER_OF_KEYS
 o ACTIONS
 protected static final String ACTIONS[]

Constructors

 o CertificateBrowserApp
 public CertificateBrowserApp()
Empty constructor.

 o CertificateBrowserApp
 public CertificateBrowserApp(CertBag identityBag,
                              CertBag peerBag,
                              ModuleInformation initialisedModules)
Constructs the CertificateBrowserApp for the user 's certificates and the received ones, taking into account the existing initialised modules.

Parameters:
identityBag - the CertBag that holds all the certificates of the user
peerBag - the CertBag that holds all the received certificates of the user.
initialisedModules - the information about the initialised modules.

Methods

 o launch
 public void launch()
Implements the MenuLaunchable interface.

Overrides:
launch in class Browser
 o getCertificates
 public Browseable[] getCertificates(CertBag certBag,
                                     TinguinSession display) throws Exception
Retrieves the certificates and creates the table containing the browseable objects. If there are no certificates it prompts the user to import one.

Parameters:
certBag - the CertBag that contains the certificates and the situations.
display - the TinguinSession created for the Certificate Browser Application.
Returns:
a table of Browseable objects (Certificates).
 o certificateBrowser
 public void certificateBrowser() throws Exception
Interacts with the user via a TINGUIN session. The user can select between browsing his own certificates or the ones he has received.

 o certificatePolicy
 public void certificatePolicy(CertBag certBag,
                               TinguinSession display) throws Exception
The user has chosen which certificates he wants to browse. This method displays 3 options : viewing the certificate list, viewing the policy list, or import a certificate from a file.

Parameters:
certBag - the CertBag that contains the certificates and the situations.
display - is the session created for the Certificate Browser Application
 o policyList
 public void policyList(CertBag certBag,
                        TinguinSession display)
Lists all the policies found in certificate bag.

Parameters:
certBag - the CertBag that contains the certificates and the situations.
display - is the session created for the Certificate Browser Application
 o viewPolicyCertificates
 public void viewPolicyCertificates(CertBag certBag,
                                    int target,
                                    TinguinSession display)
Lists all the certificates that can be used with the selected policy.

Parameters:
certBag - the CertBag that contains the certificates and the situations.
target - identifies the policy that the user has selected
display - is the session created for the Certificate Browser Application.
 o remove
 public void remove(Certificate cert) throws Exception
Removes a certificate of the archive and the CertBag, that stores it.

Parameters:
cert - certificate that will be removed.
 o viewFingerprints
 public void viewFingerprints(Certificate cert) throws CertificateManException
Displays the fingerprint of the certificate 's public key, as well as the fingerprint of the CA 's public key.

Parameters:
cert - is the certificate for which the fingerprint will be displayed.
Throws: CertificateManException,
if for some reason, the fingerprint could not be displayed.
 o verify
 public void verify(Certificate cert) throws CertificateManException
Verifies the correctness of the selected certificate (ie whether signature matches its contents).

Parameters:
cert - is the certificate to be verified.
Throws: CertificateManException,
if for some reason, the Public Key of the CA is not stored.
 o viewPolicy
 public void viewPolicy(Certificate cert)
Displays the policy for a selected certificate.

Parameters:
cert - is the certificates of which the policy is displayed.
 o getNewPolicy
 public void getNewPolicy(TinguinSession display,
                          boolean change,
                          CertBag certBag,
                          int target,
                          Certificate cert,
                          String s)
Changes an already stored policy or adds a new one to the selected certificate.

Parameters:
display - is the session created for the Certificate Browser Application.
change - if it is true then a policy will be changed, otherwise a new one will be added.
certBag - the CertBag that contains the certificates and the situations.
target - identifies the selected policy.
cert - is the selected certificate.
s - is the string that should be displayed on the window (in case a policy is changed or added).
 o removePolicy
 public boolean removePolicy(TinguinSession display,
                             CertBag certBag,
                             Situation policyId,
                             Certificate cert)
Removes an already stored policy of the selected certificate.

Parameters:
display - is the session created for the Certificate Browser Application.
certBag - the CertBag that contains the certificates and the situations.
policyId - identifies the selected policy.
cert - is the selected certificate.
Returns:
true if the policy is removed, false otherwise.
 o exportToFile
 public void exportToFile(Certificate cert) throws IOException, CryptoManException, CertificateManException
Exports a certificate object to a file with extension *.crt, as well as the corresponding private key to a file with extension *.key.

Parameters:
cert - the certificate that will be exported.
 o importFromFile
 public void importFromFile(CertBag certBag,
                            TinguinSession display) throws Exception, CryptoManException
Imports a certificate object from a file (*.crt), as well as the corresponding private key from a file with extension *.key.

Parameters:
certBag - the CertBag that contains the certificates and the situations.
display - is the session created for the Certificate Browser Application.
 o compareTo
 public int compareTo(Browseable one,
                      Browseable two,
                      int keyno,
                      boolean reverse)
Compare with given object.

Returns:
an integer that shows which should be displayed first
See Also:
compareTo
 o getKeys
 public String[] getKeys()
Obtain the names of the keys which can be used to sort.

Returns:
the names of the keys
See Also:
getKeys
 o getActions
 public String[] getActions()
Sets the names of the actions that should be displayed on the TINGUIN.This method is dynamically invoked by the method interact2 of the Browser class.

Returns:
a table containing the names of the actions.
 o getMethodName
 public String getMethodName(int n)
Finds the name of the method that for the selected action.

Parameters:
n - identifies the selected action.
Returns:
the name of the method.

All Packages  Class Hierarchy  This Package  Previous  Next  Index