gui
Class CertDetailsDialog

java.lang.Object
  extended by gui.dialog.JAPDialog
      extended by gui.CertDetailsDialog
All Implemented Interfaces:
IDialogOptions, java.awt.event.MouseListener, java.awt.image.ImageObserver, java.awt.MenuContainer, java.util.EventListener, javax.accessibility.Accessible, javax.swing.RootPaneContainer, javax.swing.WindowConstants

public class CertDetailsDialog
extends JAPDialog
implements java.awt.event.MouseListener

CertDetails Dialog

Description: Displays any certificates

Author:
Kuno G. Gruen

Nested Class Summary
private  class CertDetailsDialog.CertPathListCellRenderer
           
static class CertDetailsDialog.CertShortInfoPanel
           
 
Nested classes/interfaces inherited from class gui.dialog.JAPDialog
JAPDialog.AbstractLinkedURLAdapter, JAPDialog.ILinkedInformation, JAPDialog.LinkedCheckBox, JAPDialog.LinkedHelpContext, JAPDialog.LinkedInformation, JAPDialog.LinkedInformationAdapter, JAPDialog.LinkedURLCheckBox, JAPDialog.Options
 
Field Summary
private  java.awt.Color ALERT_COLOR
           
private  java.awt.Font ALERT_FONT
           
private static java.lang.String CERT_INVALID_INACTIVE
           
private static java.lang.String CERT_VALID_INACTIVE
           
private static java.lang.String IMG_CERT_BLUE_INVALID
           
private static java.lang.String IMG_CERT_BLUE_INVALID_DARK
           
private static java.lang.String IMG_CERT_BLUE_NOK
           
private static java.lang.String IMG_CERT_BLUE_NOK_DARK
           
private static java.lang.String IMG_CERT_BLUE_OK
           
private static java.lang.String IMG_CERT_BLUE_OK_DARK
           
private static java.lang.String IMG_CERT_ORANGE_INVALID
           
private static java.lang.String IMG_CERT_ORANGE_INVALID_DARK
           
private static java.lang.String IMG_CERT_ORANGE_NOK
           
private static java.lang.String IMG_CERT_ORANGE_NOK_DARK
           
private static java.lang.String IMG_CERT_ORANGE_OK
           
private static java.lang.String IMG_CERT_ORANGE_OK_DARK
           
private static java.lang.String IMG_CERT_PURPLE_INVALID
           
private static java.lang.String IMG_CERT_PURPLE_INVALID_DARK
           
private static java.lang.String IMG_CERT_PURPLE_NOK
           
private static java.lang.String IMG_CERT_PURPLE_NOK_DARK
           
private static java.lang.String IMG_CERT_PURPLE_OK
           
private static java.lang.String IMG_CERT_PURPLE_OK_DARK
           
static java.lang.String IMG_CERTDISABLEDICON
           
static java.lang.String IMG_CERTENABLEDICON
           
private static java.lang.String IMG_PATH
           
static java.lang.String IMG_WARNING
           
private  java.awt.Font KEY_FONT
           
private  javax.swing.JLabel LABEL
           
private  javax.swing.JLabel lbl_summaryIcon
           
private  javax.swing.JList m_certList
           
private  javax.swing.DefaultListModel m_certListModel
           
private  JAPCertificate m_detailedCert
           
private  java.util.Locale m_Locale
           
private  CertDetailsDialog.CertShortInfoPanel m_shortInfoPanel
           
private  javax.swing.JTabbedPane m_tabbedPane
           
private static java.lang.String MSG_ALERT_CERTDATE_EXPIRED
           
private static java.lang.String MSG_ALERT_CERTDATE_NOTYET
           
private static java.lang.String MSG_ALERT_NOT_TRUSTED
           
private static java.lang.String MSG_ALERT_SELF_SIGNED
           
private static java.lang.String MSG_CERT_HIERARCHY
           
private static java.lang.String MSG_CERT_INFO_BORDER
           
static java.lang.String MSG_CERT_NOT_VERIFIED
           
static java.lang.String MSG_CERT_VERIFIED
           
static java.lang.String MSG_CERTNOTVALID
           
static java.lang.String MSG_CERTVALID
           
private static java.lang.String MSG_DETAILS
           
private static java.lang.String MSG_SHOW_CERT
           
private static java.lang.String MSG_SYMBOLS
           
private static java.lang.String MSG_TITLE
           
private static java.lang.String MSG_X509Attribute_C
           
private static java.lang.String MSG_X509Attribute_CN
           
private static java.lang.String MSG_X509Attribute_EMAIL
           
private static java.lang.String MSG_X509Attribute_EMAILADDRESS
           
private static java.lang.String MSG_X509Attribute_GIVENNAME
           
private static java.lang.String MSG_X509Attribute_L
           
private static java.lang.String MSG_X509Attribute_O
           
private static java.lang.String MSG_X509Attribute_OU
           
private static java.lang.String MSG_X509Attribute_ST
           
private static java.lang.String MSG_X509Attribute_SURNAME
           
private  java.lang.String str
           
private  java.awt.Color TITLE_COLOR
           
private static java.lang.String TITLE_DISTINGUISHEDNAME
           
private static java.lang.String TITLE_EXTENSIONS
           
private  java.awt.Font TITLE_FONT
           
private static java.lang.String TITLE_IDENTIFICATION
           
private static java.lang.String TITLE_IDENTIFICATION_MD5
           
private static java.lang.String TITLE_IDENTIFICATION_SERIAL
           
private static java.lang.String TITLE_IDENTIFICATION_SHA1
           
private static java.lang.String TITLE_ISSUER
           
private static java.lang.String TITLE_KEYS
           
private static java.lang.String TITLE_KEYS_ALGORITHM
           
private static java.lang.String TITLE_KEYS_KEYLENGTH
           
private static java.lang.String TITLE_KEYS_SIGNALGORITHM
           
private static java.lang.String TITLE_VALIDITY
           
private static java.lang.String TITLE_VALIDITY_FROM
           
private static java.lang.String TITLE_VALIDITY_GENERAL
           
private static java.lang.String TITLE_VALIDITY_TO
           
private static java.lang.String UNKNOWN_EXTENSION
           
private  java.awt.Font VALUE_FONT
           
 
Fields inherited from class gui.dialog.JAPDialog
FORMAT_DEFAULT_SCREEN, FORMAT_GOLDEN_RATIO_PHI, FORMAT_WIDE_SCREEN, MSG_BTN_PROCEED, MSG_BTN_RETRY, MSG_ERROR_UNDISPLAYABLE, MSG_ERROR_UNKNOWN, MSG_TITLE_CONFIRMATION, MSG_TITLE_ERROR, MSG_TITLE_INFO, MSG_TITLE_WARNING, XML_ATTR_OPTIMIZED_FORMAT
 
Fields inherited from interface javax.swing.WindowConstants
DISPOSE_ON_CLOSE, DO_NOTHING_ON_CLOSE, EXIT_ON_CLOSE, HIDE_ON_CLOSE
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Fields inherited from interface gui.dialog.IDialogOptions
MESSAGE_TYPE_ERROR, MESSAGE_TYPE_INFORMATION, MESSAGE_TYPE_PLAIN, MESSAGE_TYPE_QUESTION, MESSAGE_TYPE_WARNING, OPTION_TYPE_CANCEL, OPTION_TYPE_DEFAULT, OPTION_TYPE_EMPTY, OPTION_TYPE_OK_CANCEL, OPTION_TYPE_YES_NO, OPTION_TYPE_YES_NO_CANCEL, RETURN_VALUE_CANCEL, RETURN_VALUE_CLOSED, RETURN_VALUE_NO, RETURN_VALUE_OK, RETURN_VALUE_UNINITIALIZED, RETURN_VALUE_YES
 
Constructor Summary
CertDetailsDialog(java.awt.Component a_parent, JAPCertificate a_cert, boolean a_bIsVerifyable, java.util.Locale a_locale)
           
CertDetailsDialog(java.awt.Component a_parent, JAPCertificate a_cert, boolean a_bIsVerifyable, java.util.Locale a_locale, CertPath a_certPath)
           
 
Method Summary
private  javax.swing.JPanel drawCertPathPanel(CertPath a_certPath)
          Draws the Panel that shows the certification Path
private  TitledGridBagPanel drawDetailsPanel(JAPCertificate a_cert, boolean a_bIsVerifyable)
           
private  java.util.Vector idsToNames(java.util.Vector a_vector)
          Translates a Vector of numerical identifiers into human readable names
 void mouseClicked(java.awt.event.MouseEvent e)
          Invoked when the mouse button has been clicked (pressed and released) on a component.
 void mouseEntered(java.awt.event.MouseEvent e)
          Invoked when the mouse enters a component.
 void mouseExited(java.awt.event.MouseEvent e)
          Invoked when the mouse exits a component.
 void mousePressed(java.awt.event.MouseEvent e)
          Invoked when a mouse button has been pressed on a component.
 void mouseReleased(java.awt.event.MouseEvent e)
          Invoked when a mouse button has been released on a component.
private  void replaceCountryCodeByCountryName(java.util.Vector a_attributes, java.util.Vector a_identifiers)
          Looks for the C identifier and replaces the corresponding attribute by a country name if possible.
private  void setSize()
           
private  void showCert()
           
 
Methods inherited from class gui.dialog.JAPDialog
addComponentListener, addWindowListener, dispose, doClosingOnContentPaneCancel, getAccessibleContext, getContentPane, getDefaultCloseOperation, getFont, getGlassPane, getInsets, getJMenuBar, getLayeredPane, getLocation, getName, getOptimizedFormat, getOptimizedFormatDelta, getOptimizedFormatDelta, getOptimizedFormatInternal, getOwner, getParentComponent, getPreferredSize, getRootPane, getScreenBounds, getSize, getTitle, imageUpdate, isClosingOnContentPaneCancel, isConsoleOnly, isDisposed, isEnabled, isModal, isResizable, isVisible, moveToUpRightCorner, pack, postEvent, remove, removeComponentListener, removeWindowListener, requestFocus, resetAutomaticLocation, restoreLocation, restoreSize, retrieveErrorMessage, setAlwaysOnTop, setConsoleOnly, setContentPane, setDefaultCloseOperation, setDockable, setEnabled, setGlassPane, setJMenuBar, setLayeredPane, setLocation, setLocation, setLocationCenteredOn, setLocationCenteredOnOwner, setLocationCenteredOnParent, setLocationCenteredOnScreen, setLocationRelativeToOwner, setModal, setName, setOptimizedFormat, setResizable, setSize, setSize, setTitle, setVisible, setVisible, showConfirmDialog, showConfirmDialog, showConfirmDialog, showConfirmDialog, showConfirmDialog, showConfirmDialog, showConfirmDialog, showConfirmDialog, showConfirmDialog, showConfirmDialog, showConfirmDialog, showConfirmDialog, showConfirmDialog, showConfirmDialog, showConfirmDialog, showConfirmDialog, showConfirmDialog, showConfirmDialog, showErrorDialog, showErrorDialog, showErrorDialog, showErrorDialog, showErrorDialog, showErrorDialog, showErrorDialog, showErrorDialog, showErrorDialog, showErrorDialog, showErrorDialog, showErrorDialog, showErrorDialog, showErrorDialog, showErrorDialog, showMessageDialog, showMessageDialog, showMessageDialog, showMessageDialog, showMessageDialog, showMessageDialog, showMessageDialog, showMessageDialog, showMessageDialog, showMessageDialog, showMessageDialog, showMessageDialog, showMessageDialog, showMessageDialog, showMessageDialog, showMessageDialog, showWarningDialog, showWarningDialog, showWarningDialog, showWarningDialog, showWarningDialog, showWarningDialog, showWarningDialog, showWarningDialog, showYesNoDialog, showYesNoDialog, showYesNoDialog, showYesNoDialog, showYesNoDialog, showYesNoDialog, showYesNoDialog, showYesNoDialog, toBack, toFront, validate
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MSG_CERTVALID

public static final java.lang.String MSG_CERTVALID

MSG_CERTNOTVALID

public static final java.lang.String MSG_CERTNOTVALID

MSG_CERT_VERIFIED

public static final java.lang.String MSG_CERT_VERIFIED

MSG_CERT_NOT_VERIFIED

public static final java.lang.String MSG_CERT_NOT_VERIFIED

MSG_TITLE

private static final java.lang.String MSG_TITLE

MSG_X509Attribute_ST

private static final java.lang.String MSG_X509Attribute_ST

MSG_X509Attribute_L

private static final java.lang.String MSG_X509Attribute_L

MSG_X509Attribute_C

private static final java.lang.String MSG_X509Attribute_C

MSG_X509Attribute_CN

private static final java.lang.String MSG_X509Attribute_CN

MSG_X509Attribute_O

private static final java.lang.String MSG_X509Attribute_O

MSG_X509Attribute_OU

private static final java.lang.String MSG_X509Attribute_OU

MSG_X509Attribute_EMAIL

private static final java.lang.String MSG_X509Attribute_EMAIL

MSG_SHOW_CERT

private static final java.lang.String MSG_SHOW_CERT

MSG_CERT_HIERARCHY

private static final java.lang.String MSG_CERT_HIERARCHY

MSG_SYMBOLS

private static final java.lang.String MSG_SYMBOLS

MSG_DETAILS

private static final java.lang.String MSG_DETAILS

MSG_X509Attribute_EMAILADDRESS

private static final java.lang.String MSG_X509Attribute_EMAILADDRESS

MSG_X509Attribute_SURNAME

private static final java.lang.String MSG_X509Attribute_SURNAME

MSG_X509Attribute_GIVENNAME

private static final java.lang.String MSG_X509Attribute_GIVENNAME

MSG_ALERT_CERTDATE_EXPIRED

private static final java.lang.String MSG_ALERT_CERTDATE_EXPIRED

MSG_ALERT_CERTDATE_NOTYET

private static final java.lang.String MSG_ALERT_CERTDATE_NOTYET

MSG_ALERT_SELF_SIGNED

private static final java.lang.String MSG_ALERT_SELF_SIGNED

MSG_ALERT_NOT_TRUSTED

private static final java.lang.String MSG_ALERT_NOT_TRUSTED

UNKNOWN_EXTENSION

private static final java.lang.String UNKNOWN_EXTENSION

TITLE_DISTINGUISHEDNAME

private static final java.lang.String TITLE_DISTINGUISHEDNAME

TITLE_ISSUER

private static final java.lang.String TITLE_ISSUER

TITLE_VALIDITY

private static final java.lang.String TITLE_VALIDITY

TITLE_VALIDITY_GENERAL

private static final java.lang.String TITLE_VALIDITY_GENERAL

TITLE_VALIDITY_TO

private static final java.lang.String TITLE_VALIDITY_TO

TITLE_VALIDITY_FROM

private static final java.lang.String TITLE_VALIDITY_FROM

TITLE_EXTENSIONS

private static final java.lang.String TITLE_EXTENSIONS

TITLE_IDENTIFICATION

private static final java.lang.String TITLE_IDENTIFICATION

TITLE_IDENTIFICATION_SHA1

private static final java.lang.String TITLE_IDENTIFICATION_SHA1

TITLE_IDENTIFICATION_MD5

private static final java.lang.String TITLE_IDENTIFICATION_MD5

TITLE_IDENTIFICATION_SERIAL

private static final java.lang.String TITLE_IDENTIFICATION_SERIAL

TITLE_KEYS

private static final java.lang.String TITLE_KEYS

TITLE_KEYS_ALGORITHM

private static final java.lang.String TITLE_KEYS_ALGORITHM

TITLE_KEYS_KEYLENGTH

private static final java.lang.String TITLE_KEYS_KEYLENGTH

TITLE_KEYS_SIGNALGORITHM

private static final java.lang.String TITLE_KEYS_SIGNALGORITHM

MSG_CERT_INFO_BORDER

private static final java.lang.String MSG_CERT_INFO_BORDER

CERT_VALID_INACTIVE

private static final java.lang.String CERT_VALID_INACTIVE
See Also:
Constant Field Values

CERT_INVALID_INACTIVE

private static final java.lang.String CERT_INVALID_INACTIVE
See Also:
Constant Field Values

LABEL

private final javax.swing.JLabel LABEL

TITLE_COLOR

private final java.awt.Color TITLE_COLOR

ALERT_COLOR

private final java.awt.Color ALERT_COLOR

TITLE_FONT

private final java.awt.Font TITLE_FONT

KEY_FONT

private final java.awt.Font KEY_FONT

VALUE_FONT

private final java.awt.Font VALUE_FONT

ALERT_FONT

private final java.awt.Font ALERT_FONT

IMG_CERTENABLEDICON

public static final java.lang.String IMG_CERTENABLEDICON
See Also:
Constant Field Values

IMG_CERTDISABLEDICON

public static final java.lang.String IMG_CERTDISABLEDICON
See Also:
Constant Field Values

IMG_WARNING

public static final java.lang.String IMG_WARNING
See Also:
Constant Field Values

IMG_PATH

private static final java.lang.String IMG_PATH
See Also:
Constant Field Values

IMG_CERT_ORANGE_OK

private static final java.lang.String IMG_CERT_ORANGE_OK
See Also:
Constant Field Values

IMG_CERT_ORANGE_NOK

private static final java.lang.String IMG_CERT_ORANGE_NOK
See Also:
Constant Field Values

IMG_CERT_ORANGE_INVALID

private static final java.lang.String IMG_CERT_ORANGE_INVALID
See Also:
Constant Field Values

IMG_CERT_ORANGE_OK_DARK

private static final java.lang.String IMG_CERT_ORANGE_OK_DARK
See Also:
Constant Field Values

IMG_CERT_ORANGE_NOK_DARK

private static final java.lang.String IMG_CERT_ORANGE_NOK_DARK
See Also:
Constant Field Values

IMG_CERT_ORANGE_INVALID_DARK

private static final java.lang.String IMG_CERT_ORANGE_INVALID_DARK
See Also:
Constant Field Values

IMG_CERT_PURPLE_OK

private static final java.lang.String IMG_CERT_PURPLE_OK
See Also:
Constant Field Values

IMG_CERT_PURPLE_NOK

private static final java.lang.String IMG_CERT_PURPLE_NOK
See Also:
Constant Field Values

IMG_CERT_PURPLE_INVALID

private static final java.lang.String IMG_CERT_PURPLE_INVALID
See Also:
Constant Field Values

IMG_CERT_PURPLE_OK_DARK

private static final java.lang.String IMG_CERT_PURPLE_OK_DARK
See Also:
Constant Field Values

IMG_CERT_PURPLE_NOK_DARK

private static final java.lang.String IMG_CERT_PURPLE_NOK_DARK
See Also:
Constant Field Values

IMG_CERT_PURPLE_INVALID_DARK

private static final java.lang.String IMG_CERT_PURPLE_INVALID_DARK
See Also:
Constant Field Values

IMG_CERT_BLUE_OK

private static final java.lang.String IMG_CERT_BLUE_OK
See Also:
Constant Field Values

IMG_CERT_BLUE_NOK

private static final java.lang.String IMG_CERT_BLUE_NOK
See Also:
Constant Field Values

IMG_CERT_BLUE_INVALID

private static final java.lang.String IMG_CERT_BLUE_INVALID
See Also:
Constant Field Values

IMG_CERT_BLUE_OK_DARK

private static final java.lang.String IMG_CERT_BLUE_OK_DARK
See Also:
Constant Field Values

IMG_CERT_BLUE_NOK_DARK

private static final java.lang.String IMG_CERT_BLUE_NOK_DARK
See Also:
Constant Field Values

IMG_CERT_BLUE_INVALID_DARK

private static final java.lang.String IMG_CERT_BLUE_INVALID_DARK
See Also:
Constant Field Values

lbl_summaryIcon

private javax.swing.JLabel lbl_summaryIcon

m_Locale

private java.util.Locale m_Locale

str

private java.lang.String str

m_shortInfoPanel

private CertDetailsDialog.CertShortInfoPanel m_shortInfoPanel

m_certList

private javax.swing.JList m_certList

m_tabbedPane

private javax.swing.JTabbedPane m_tabbedPane

m_certListModel

private javax.swing.DefaultListModel m_certListModel

m_detailedCert

private JAPCertificate m_detailedCert
Constructor Detail

CertDetailsDialog

public CertDetailsDialog(java.awt.Component a_parent,
                         JAPCertificate a_cert,
                         boolean a_bIsVerifyable,
                         java.util.Locale a_locale,
                         CertPath a_certPath)
Parameters:
a_parent - The parent object
a_cert - JAPCertificate which will be shown
a_bIsVerifyable - boolean indicating if the cert has been verified
a_locale - the current locale
a_certPath - the certPath of the displayed certificate

CertDetailsDialog

public CertDetailsDialog(java.awt.Component a_parent,
                         JAPCertificate a_cert,
                         boolean a_bIsVerifyable,
                         java.util.Locale a_locale)
Parameters:
a_parent - The parent object
a_cert - JAPCertificate which will be shown
a_bIsVerifyable - boolean indicating if the cert has been verified
a_locale - the current locale
Method Detail

setSize

private void setSize()

idsToNames

private java.util.Vector idsToNames(java.util.Vector a_vector)
Translates a Vector of numerical identifiers into human readable names

Parameters:
a_vector - Vector with numerical identifiers
Returns:
a Vector with human readable Strings
See Also:
anon.crypto.X509DistinguishedName.getAttributeNameFromAttributeIdentifier()

drawDetailsPanel

private TitledGridBagPanel drawDetailsPanel(JAPCertificate a_cert,
                                            boolean a_bIsVerifyable)

drawCertPathPanel

private javax.swing.JPanel drawCertPathPanel(CertPath a_certPath)
Draws the Panel that shows the certification Path

Parameters:
a_certPath - The certPath of the Certificate that is shown in this CertDetailsDialog
Returns:
the Panel that showes the certification Path

showCert

private void showCert()

replaceCountryCodeByCountryName

private void replaceCountryCodeByCountryName(java.util.Vector a_attributes,
                                             java.util.Vector a_identifiers)
Looks for the C identifier and replaces the corresponding attribute by a country name if possible.

Parameters:
a_attributes - a Vector with distinguished name attributes
a_identifiers - a Vector with identifiers corresponding with the dn attributes

mouseClicked

public void mouseClicked(java.awt.event.MouseEvent e)
Invoked when the mouse button has been clicked (pressed and released) on a component.

Specified by:
mouseClicked in interface java.awt.event.MouseListener

mousePressed

public void mousePressed(java.awt.event.MouseEvent e)
Invoked when a mouse button has been pressed on a component.

Specified by:
mousePressed in interface java.awt.event.MouseListener

mouseReleased

public void mouseReleased(java.awt.event.MouseEvent e)
Invoked when a mouse button has been released on a component.

Specified by:
mouseReleased in interface java.awt.event.MouseListener

mouseEntered

public void mouseEntered(java.awt.event.MouseEvent e)
Invoked when the mouse enters a component.

Specified by:
mouseEntered in interface java.awt.event.MouseListener

mouseExited

public void mouseExited(java.awt.event.MouseEvent e)
Invoked when the mouse exits a component.

Specified by:
mouseExited in interface java.awt.event.MouseListener