public final class PassphraseDialog extends javax.swing.JDialog implements PassphrasePrompt
javax.swing.JDialog.AccessibleJDialogjava.awt.Dialog.AccessibleAWTDialog, java.awt.Dialog.ModalExclusionType, java.awt.Dialog.ModalityTypejava.awt.Window.AccessibleAWTWindow, java.awt.Window.Type| Modifier and Type | Field and Description |
|---|---|
protected boolean |
cancelAllowed_
indicates if this passphrase dialog can be canceled by the user with entering a password
|
protected javax.swing.JFrame |
dummyOwner_
the dummy frame we use if we have no other
|
protected java.awt.GridBagLayout |
gridBagLayout1_
Layout for content pane
|
protected javax.swing.JButton |
jButtonOK_
OK button
|
protected javax.swing.JLabel |
jLPassphrase_
Label for passphrase field
|
protected javax.swing.JPasswordField |
jPFPassphrase_
Passphrase field
|
protected javax.swing.JTextArea |
jTAMsg_
text area to display message
|
static java.lang.String |
LINE_SEPARATOR
The separator used to separate lines in the message component.
|
protected java.lang.String |
message_
Message in this dialog
|
protected javax.swing.JPanel |
panel1_
Content pane
|
protected char[] |
passphrase_
The passphrase
|
protected java.lang.Object |
protectedResourceInfo_
Object specifying the protected resource; e.g.
|
protected static java.util.ResourceBundle |
res_
Used to read strings from (internationalization)
|
protected java.lang.String |
title_
Title of this dialog
|
accessibleContext, rootPane, rootPaneCheckingEnabledBOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT| Constructor and Description |
|---|
PassphraseDialog()
Empty constructor.
|
PassphraseDialog(java.awt.Frame owner,
java.lang.String title)
Construct a new PasswordDialog with the specified dialog title.
|
PassphraseDialog(java.awt.Frame owner,
java.lang.String title,
java.lang.Object promptMessageObject)
Construct a new PasswordDialog with the specified dialog title and the specified message as
label for the passphrase field.
|
PassphraseDialog(java.lang.String title)
Construct a new PasswordDialog with the specified dialog title.
|
PassphraseDialog(java.lang.String title,
java.lang.Object promptMessageObject)
Construct a new PasswordDialog with the specified dialog title and the specified message as
label for the passphrase field.
|
| Modifier and Type | Method and Description |
|---|---|
protected void |
dialogInit()
Initialize all components of this dialog.
|
protected void |
fillMessage()
This method fills the
jTAMsg_ component which holds the message. |
char[] |
getPassphrase()
Gets the passphrase that was entered by the user and delete the internal copy of the password
afterwards.
|
boolean |
isCancelAllowed()
Check, if the user can cancel this dialog; e.g.
|
static void |
main(java.lang.String[] args)
For testing only.
|
protected void |
okActionPerformed()
Wraps actions to perform on OK.
|
void |
paint(java.awt.Graphics g)
We have overridden this method to set the input focus to the password field when the dialog is
painted the first time.
|
char[] |
promptPassphrase()
Show this dialog and return the entered password.
|
void |
setCancelAllowed(boolean allowCancel)
Set, if the user is allowed to cancel this dialog without entering a password.
|
void |
setMessage(java.lang.Object promptMessageObject)
Set the message to be displayed by this dialog.
|
void |
setProtectedResourceInfo(java.lang.Object protectedResourceInfo)
Set the object that represents the protected resources; i.e.
|
void |
show()
Show this dialog.
|
addImpl, createRootPane, getAccessibleContext, getContentPane, getDefaultCloseOperation, getGlassPane, getGraphics, getJMenuBar, getLayeredPane, getRootPane, getTransferHandler, isDefaultLookAndFeelDecorated, isRootPaneCheckingEnabled, paramString, processWindowEvent, remove, repaint, setContentPane, setDefaultCloseOperation, setDefaultLookAndFeelDecorated, setGlassPane, setJMenuBar, setLayeredPane, setLayout, setRootPane, setRootPaneCheckingEnabled, setTransferHandler, updateaddNotify, getModalityType, getTitle, hide, isModal, isResizable, isUndecorated, setBackground, setModal, setModalityType, setOpacity, setResizable, setShape, setTitle, setUndecorated, setVisible, toBackaddPropertyChangeListener, addPropertyChangeListener, addWindowFocusListener, addWindowListener, addWindowStateListener, applyResourceBundle, applyResourceBundle, createBufferStrategy, createBufferStrategy, dispose, getBackground, getBufferStrategy, getFocusableWindowState, getFocusCycleRootAncestor, getFocusOwner, getFocusTraversalKeys, getIconImages, getInputContext, getListeners, getLocale, getModalExclusionType, getMostRecentFocusOwner, getOpacity, getOwnedWindows, getOwner, getOwnerlessWindows, getShape, getToolkit, getType, getWarningString, getWindowFocusListeners, getWindowListeners, getWindows, getWindowStateListeners, isActive, isAlwaysOnTop, isAlwaysOnTopSupported, isAutoRequestFocus, isFocusableWindow, isFocusCycleRoot, isFocused, isLocationByPlatform, isOpaque, isShowing, isValidateRoot, pack, postEvent, processEvent, processWindowFocusEvent, processWindowStateEvent, removeNotify, removeWindowFocusListener, removeWindowListener, removeWindowStateListener, reshape, setAlwaysOnTop, setAutoRequestFocus, setBounds, setBounds, setCursor, setFocusableWindowState, setFocusCycleRoot, setIconImage, setIconImages, setLocation, setLocation, setLocationByPlatform, setLocationRelativeTo, setMinimumSize, setModalExclusionType, setSize, setSize, setType, toFrontadd, add, add, add, add, addContainerListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalPolicy, getInsets, getLayout, getMaximumSize, getMinimumSize, getMousePosition, getPreferredSize, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, print, printComponents, processContainerEvent, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusTraversalKeys, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setFont, transferFocusDownCycle, validate, validateTreeaction, 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, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBaseline, getBaselineResizeBehavior, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphicsConfiguration, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocation, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, 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, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, 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, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resize, resize, revalidate, setComponentOrientation, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setMaximumSize, setName, setPreferredSize, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCyclepublic static final java.lang.String LINE_SEPARATOR
protected static java.util.ResourceBundle res_
protected boolean cancelAllowed_
protected javax.swing.JPanel panel1_
protected java.awt.GridBagLayout gridBagLayout1_
protected javax.swing.JTextArea jTAMsg_
protected javax.swing.JLabel jLPassphrase_
protected javax.swing.JPasswordField jPFPassphrase_
protected javax.swing.JButton jButtonOK_
protected javax.swing.JFrame dummyOwner_
protected java.lang.String title_
protected java.lang.String message_
protected java.lang.Object protectedResourceInfo_
protected char[] passphrase_
public PassphraseDialog()
public PassphraseDialog(java.lang.String title)
title - The title of the dialog box.public PassphraseDialog(java.lang.String title,
java.lang.Object promptMessageObject)
title - The title of the dialog box.promptMessageObject - The label text object for the passphrase field.public PassphraseDialog(java.awt.Frame owner,
java.lang.String title)
owner - The parent frame.title - The title of the dialog box.public PassphraseDialog(java.awt.Frame owner,
java.lang.String title,
java.lang.Object promptMessageObject)
owner - The parent frame.title - The title of the dialog box.promptMessageObject - The label text object for the passphrase field.public void setMessage(java.lang.Object promptMessageObject)
toString() of this object.setMessage in interface PassphraseInterfaccepromptMessageObject - The message object.public void setProtectedResourceInfo(java.lang.Object protectedResourceInfo)
toString().setProtectedResourceInfo in interface PassphraseInterfacceprotectedResourceInfo - The resource info object.public void show()
show in class java.awt.Dialogpublic void paint(java.awt.Graphics g)
paint in class java.awt.Windowg - see Container.paint(java.awt.Graphics).public char[] getPassphrase()
public boolean isCancelAllowed()
isCancelAllowed in interface PassphraseInterfaccepublic void setCancelAllowed(boolean allowCancel)
setCancelAllowed in interface PassphraseInterfacceallowCancel - True, to allow the user to cancel the dialog.public char[] promptPassphrase()
getPassphrase() method, because this method already
calls this method.promptPassphrase in interface PassphrasePromptprotected void fillMessage()
jTAMsg_ component which holds the message. It fills it with the
prompt message followed by information about the protected resource; e.g. the token label, if
the resource info is a TokenInfo object. A subclass may override this method to
display different things to the user.protected void dialogInit()
dialogInit in class javax.swing.JDialogprotected void okActionPerformed()
public static void main(java.lang.String[] args)
IAIK JavaSecurity Website https://jce.iaik.tugraz.at/
IAIK at Graz University of Technology, Austria, Europe
Copyright 2001-2023 IAIK, Graz University of Technology, Inffeldgasse 16a, 8010 Graz, Austria. All Rights Reserved. Version 1.9.4