|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object
|
+--java.awt.Component
|
+--java.awt.Container
|
+--java.awt.Window
|
+--java.awt.Dialog
|
+--javax.swing.JDialog
|
+--com.ca.commons.cbutil.CBDialog
|
+--com.ca.commons.security.KeystoreGUI
| Nested Class Summary | |
static class |
KeystoreGUI.CertItem
A representation of a certificate that is displayed in the certificate list. |
class |
KeystoreGUI.PasswordDialog
The keystore has a particular password protecting its contents. |
| Nested classes inherited from class javax.swing.JDialog |
javax.swing.JDialog.AccessibleJDialog |
| Nested classes inherited from class java.awt.Dialog |
java.awt.Dialog.AccessibleAWTDialog |
| Nested classes inherited from class java.awt.Window |
java.awt.Window.AccessibleAWTWindow |
| Nested classes inherited from class java.awt.Container |
java.awt.Container.AccessibleAWTContainer |
| Nested classes inherited from class java.awt.Component |
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy |
| Field Summary | |
static java.lang.String |
DELETEDCERT
|
static java.lang.String |
ERRORCERT
|
protected CBHelpSystem |
helpBroker
|
protected java.security.KeyStore |
keystore
|
protected java.lang.String |
keystoreFile
|
protected java.lang.String |
keystoreType
|
static javax.swing.ImageIcon |
smallCert
|
static javax.swing.ImageIcon |
smallKeyCert
|
| Fields inherited from class com.ca.commons.cbutil.CBDialog |
buttonPanel, Cancel, display, Help, OK, owner |
| Fields inherited from class javax.swing.JDialog |
accessibleContext, rootPane, rootPaneCheckingEnabled |
| Fields inherited from class java.awt.Component |
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT |
| 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 |
| Constructor Summary | |
KeystoreGUI(java.awt.Frame owner,
java.util.Properties props,
java.lang.String keyStoreLocation,
char[] keyStorePassword,
java.lang.String keyStoreType,
java.lang.String title,
boolean handlePrivateKeys,
java.lang.String helpTopic)
This creates the Keystore config window to manage a particular keystore. |
|
| Method Summary | |
void |
actionPerformed(java.awt.event.ActionEvent e)
checks actions on the various keystore affecting buttons. |
protected void |
addNewCert()
Allows the User to browse to a new Cert (on disk) and import it. |
protected boolean |
checkPassword()
checks that the user has entered a valid password. |
protected void |
clearPassword(char[] c)
|
protected void |
deleteCurrentCert(KeystoreGUI.CertItem certItem)
Checks the list to see which the currently selected certificate is, and then prompts the user to confirm the deletion. |
void |
doCancel()
When the user hits 'cancel', the window is shut down. |
void |
doOK()
If the user is satisfied with their changes, attempt to write the keystore. |
protected void |
exportKey(KeystoreGUI.CertItem certItem)
Allows the user to export a private key with a particular certificate. |
javax.swing.ImageIcon |
getImageIcon(java.lang.String name)
|
protected java.io.File |
getKeyFile(java.lang.String title)
This prompts the user to select a pkcs8 file to import, and attach to an existing certificate. |
static KeystoreGUI.CertItem[] |
getKeyStoreCerts(java.security.KeyStore keystore)
This extracts an array of CertItem-s from a keystore, for display in the GUI. |
protected void |
importKey(KeystoreGUI.CertItem certItem)
Allows the user to match a private key with a particular certificate. |
static void |
main(java.lang.String[] argsv)
Main method for stand alone usage and provider testing. |
static java.security.KeyStore |
readKeyStore(char[] pass,
java.lang.String storeType,
java.lang.String keyFile)
initialises the keystore by reading the saved keystore file. |
protected void |
refreshView()
Reread the key store after an addition or deletion operation, and refresh certListModel. |
protected boolean |
setPassword()
This allows the user to enter their password, which remains valid for the life of this component. |
protected void |
setupCertificateList()
Initialises a selection list of CertItems from the keystore. |
protected void |
setupCertificateListGUI()
Initialise empty list models, and associate the certificate list renderer with the cert list. |
protected boolean |
setupKeyStore()
Sets up the keystore variable, using the current password (may be null) and keystore file. |
protected void |
setupPasswords()
This allows the user to change the password used to protect the keystore. |
protected void |
viewCurrentCert(KeystoreGUI.CertItem cert)
Uses the CertViewer to display the contents of the selected certificate. |
static boolean |
writeKeyStore(char[] password,
java.security.KeyStore keystore,
java.lang.String keyFile,
java.lang.String keystoreType)
writes the keystore to a password protected file. |
| Methods inherited from class com.ca.commons.cbutil.CBDialog |
add, addln, escKeyCheck, getDisplayPanel, makeHeavy, makeLight, makeWide, quit, setHelpLink, wasCancelled |
| Methods inherited from class javax.swing.JDialog |
addImpl, createRootPane, dialogInit, getAccessibleContext, getContentPane, getDefaultCloseOperation, getGlassPane, getJMenuBar, getLayeredPane, getRootPane, isDefaultLookAndFeelDecorated, isRootPaneCheckingEnabled, paramString, processWindowEvent, remove, setContentPane, setDefaultCloseOperation, setDefaultLookAndFeelDecorated, setGlassPane, setJMenuBar, setLayeredPane, setLayout, setRootPane, setRootPaneCheckingEnabled, update |
| Methods inherited from class java.awt.Dialog |
addNotify, dispose, getTitle, hide, isModal, isResizable, isUndecorated, setModal, setResizable, setTitle, setUndecorated, show |
| Methods inherited from class java.awt.Window |
addPropertyChangeListener, addPropertyChangeListener, addWindowFocusListener, addWindowListener, addWindowStateListener, applyResourceBundle, applyResourceBundle, createBufferStrategy, createBufferStrategy, finalize, getBufferStrategy, getFocusableWindowState, getFocusCycleRootAncestor, getFocusOwner, getFocusTraversalKeys, getGraphicsConfiguration, getInputContext, getListeners, getLocale, getMostRecentFocusOwner, getOwnedWindows, getOwner, getToolkit, getWarningString, getWindowFocusListeners, getWindowListeners, getWindowStateListeners, isActive, isFocusableWindow, isFocusCycleRoot, isFocused, isShowing, pack, postEvent, processEvent, processWindowFocusEvent, processWindowStateEvent, removeWindowFocusListener, removeWindowListener, removeWindowStateListener, setCursor, setFocusableWindowState, setFocusCycleRoot, setLocationRelativeTo, toBack, toFront |
| Methods inherited from class java.awt.Container |
add, add, add, add, addContainerListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getContainerListeners, getFocusTraversalPolicy, getInsets, getLayout, getMaximumSize, getMinimumSize, getPreferredSize, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paint, paintComponents, preferredSize, print, printComponents, processContainerEvent, remove, removeAll, removeContainerListener, removeNotify, setFocusTraversalKeys, setFocusTraversalPolicy, setFont, transferFocusBackward, transferFocusDownCycle, validate, validateTree |
| Methods inherited from class java.awt.Component |
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphics, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocation, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isOpaque, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, prepareImage, prepareImage, printAll, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, reshape, resize, resize, setBackground, setBounds, setBounds, setComponentOrientation, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, setVisible, show, size, toString, transferFocus, transferFocusUpCycle |
| Methods inherited from class java.lang.Object |
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
public static final java.lang.String ERRORCERT
public static final java.lang.String DELETEDCERT
protected java.security.KeyStore keystore
public static javax.swing.ImageIcon smallCert
public static javax.swing.ImageIcon smallKeyCert
protected CBHelpSystem helpBroker
protected java.lang.String keystoreFile
protected java.lang.String keystoreType
| Constructor Detail |
public KeystoreGUI(java.awt.Frame owner,
java.util.Properties props,
java.lang.String keyStoreLocation,
char[] keyStorePassword,
java.lang.String keyStoreType,
java.lang.String title,
boolean handlePrivateKeys,
java.lang.String helpTopic)
owner - the parent frame (used for internal GUI stuff)props - the JX property list (used to get and set default keystore directories)keyStoreLocation - the location of the java keystore to manage.keyStorePassword - the password of the encrypted keystore - may be null,
in which case the user will be prompted.keyStoreType - the java abreviation of the keystore type (typically 'jks' for
'java keystore' - the default java file based keystore).title - a meaningfull (to the user) name for the keystorehandlePrivateKeys - whether the keystore manager will allow the
user to associate a private key with a particular certificate.helpTopic - the link into the default java help system (if used). SeeCBHelpSystem| Method Detail |
public void actionPerformed(java.awt.event.ActionEvent e)
actionPerformed in interface java.awt.event.ActionListenerpublic void doOK()
doOK in class CBDialogpublic void doCancel()
CBDialog
doCancel in class CBDialogprotected void importKey(KeystoreGUI.CertItem certItem)
protected void exportKey(KeystoreGUI.CertItem certItem)
protected java.io.File getKeyFile(java.lang.String title)
protected void viewCurrentCert(KeystoreGUI.CertItem cert)
cert - the certificate to display.protected void deleteCurrentCert(KeystoreGUI.CertItem certItem)
protected boolean checkPassword()
protected boolean setPassword()
This allows the user to enter their password, which remains valid for the life of this component.
This also sets up the keystore
protected boolean setupKeyStore()
protected void addNewCert()
protected void refreshView()
protected void setupCertificateListGUI()
protected void setupCertificateList()
protected void setupPasswords()
protected void clearPassword(char[] c)
public static KeystoreGUI.CertItem[] getKeyStoreCerts(java.security.KeyStore keystore)
keystore - the keystore to use.
public static java.security.KeyStore readKeyStore(char[] pass,
java.lang.String storeType,
java.lang.String keyFile)
storeType - - the type of the keystore. Unless a custom
security provider is being used, this will almost certainly
be 'jks'.keyFile - the file name of the keystore.
public static boolean writeKeyStore(char[] password,
java.security.KeyStore keystore,
java.lang.String keyFile,
java.lang.String keystoreType)
password - the password to use while saving it.keystore - the certificate key store to save.keyFile - the name of the file to save to.keystoreType - the type of store - e.g. "JKS" or "KSE" or "PKCS12"
public javax.swing.ImageIcon getImageIcon(java.lang.String name)
public static void main(java.lang.String[] argsv)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||