|
![]() |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.openpermis.editor.policy.view.PolicySigningWizard
public class PolicySigningWizard
Wizard to sign policies.
Field Summary | |
---|---|
private JTextField |
aceFile
Text field for the selection of the output file created. |
private ActionMap |
actionMap
The action map attached to this view instance. |
private static Border |
BORDER
The content border for the wizard. |
private static String |
CHOOSER_TEXT
The text on the directory chooser buttons. |
private JPanel |
content
The wizard content pane. |
private JButton |
defaultButton
The default button of the wizard. |
private JDialog |
dialog
The wizard dialog component. |
private static org.slf4j.Logger |
LOGGER
The logger of this class. |
private static String |
NEXT_FOCUS
Client property for chooser buttons that contains the next focus field. |
private JPasswordField |
password
Password field for the PKCS12 password. |
private JTextField |
pkcs12File
Text field for the selection of the PKCS12 file. |
private String |
policy
The string data of the policy to export to the ace file. |
private org.openpermis.policy.io.PolicyException |
policyException
The exception describing a policy problem if policy is null . |
private org.jdesktop.application.ResourceMap |
resourceMap
The resource map attached to this view instance. |
private static int |
TEXT_FIELD_COLUMNS
The number of columns in a text field. |
Constructor Summary | |
---|---|
PolicySigningWizard(org.jdesktop.application.ApplicationContext context,
org.openpermis.policy.bean.PolicyBean policy)
Creates a wizard to sign policies. |
Method Summary | ||
---|---|---|
void |
cancel()
Action to close the wizard without executing it. |
|
private
|
configure(T component,
JLabel label)
Configures the specified text component. |
|
private JButton |
createChooser(JTextField target,
int type,
PolicyFileFilter filter)
Creates a file chooser button for the specified target field. |
|
protected org.openpermis.cert.KeyStoreReader |
createKeyStoreReader(File input,
char[] pw)
Creates a key store reader for the specified input file and password. |
|
private JLabel |
createLabel(String name)
Creates a named label for automated translation. |
|
private JPasswordField |
createPasswordField(JLabel label)
Creates and configures a password field. |
|
protected String |
createPolicyString(org.openpermis.policy.bean.PolicyBean policyBean)
Creates a string representation of the policy of this wizard. |
|
private JComponent |
createSeparator(String name)
Creates a named separator for automated translation. |
|
protected boolean |
createSignedPolicy(File input,
char[] pw,
File output)
Creates a signed policy with the specified input pkcs12 file, password and output file. |
|
private JTextField |
createTextField(JLabel label)
Creates and configures a text field. |
|
void |
execute()
Action to execute the signing process. |
|
protected org.openpermis.cert.AttributeCertificate |
generateAttributeCertificate(org.openpermis.cert.KeyStoreReader rd,
String policyString)
Generates an attribute certificate for the specified key store reader and policy. |
|
void |
show(Component parent)
Starts the wizard. |
|
protected void |
showErrorDialog(Component parent,
String key,
Object... args)
Shows an error dialog with the specified title, message and paramters. |
|
protected void |
showErrorDialog(String key,
Object... args)
Shows an error dialog with the specified title, message and paramters. |
|
private void |
updateActions()
Updates the actions according to the values in the wizard fields. |
|
protected boolean |
writeAttributeCertificate(File output,
org.openpermis.cert.AttributeCertificate ac)
Encodes and writes an attribute certificate. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private static final org.slf4j.Logger LOGGER
private static final int TEXT_FIELD_COLUMNS
25
private static final String NEXT_FOCUS
"chooserNextFocus"
private static final String CHOOSER_TEXT
"..."
private static final Border BORDER
private final ActionMap actionMap
private final org.jdesktop.application.ResourceMap resourceMap
private String policy
private org.openpermis.policy.io.PolicyException policyException
policy
is null
.
private final JTextField pkcs12File
private final JPanel content
private final JPasswordField password
private final JTextField aceFile
private final JButton defaultButton
private JDialog dialog
Constructor Detail |
---|
public PolicySigningWizard(org.jdesktop.application.ApplicationContext context, org.openpermis.policy.bean.PolicyBean policy)
context
- the application context used to lookup the action and resource map.policy
- the policy to export to the ace file.Method Detail |
---|
private final void updateActions()
private final <T extends JTextComponent> T configure(T component, JLabel label)
Changes to the document of the text component will cause the actions of the wizard
to be updated (see updateActions()
. In addition a label for the text field
is configured.
T
- the type of text component to configure.component
- the text component to configure.label
- the label of the text component, must not be null
.
private final JComponent createSeparator(String name)
name
- the name of the separator.
private final JLabel createLabel(String name)
name
- the name of the label.
private final JTextField createTextField(JLabel label)
label
- the label of the text field.
private final JPasswordField createPasswordField(JLabel label)
label
- the label of the password field.
private final JButton createChooser(JTextField target, int type, PolicyFileFilter filter)
target
- the field to store the chosen file to.type
- the file chooser type, either JFileChooser.OPEN_DIALOG
or
JFileChooser.SAVE_DIALOG
.filter
- the file filter to use.
protected void showErrorDialog(String key, Object... args)
key
- translation key for the title.args
- optional parameters for the title and message.protected void showErrorDialog(Component parent, String key, Object... args)
parent
- the parent component to show the error dialog for.key
- translation key for the title.args
- optional parameters for the title and message.public void show(Component parent)
parent
- the parent component of the dialog.protected org.openpermis.cert.KeyStoreReader createKeyStoreReader(File input, char[] pw)
input
- the input file to read the pkcs12 data from.pw
- the password for the pkcs12 file.
null
if the key store cannot be read.protected org.openpermis.cert.AttributeCertificate generateAttributeCertificate(org.openpermis.cert.KeyStoreReader rd, String policyString)
rd
- the key store reader to use for creation of the attribute certificate.policyString
- the policy as string data to write.
null
in case of an error.protected String createPolicyString(org.openpermis.policy.bean.PolicyBean policyBean) throws org.openpermis.policy.io.PolicyException
policyBean
- the policy to create the string representation for.
null
in case of an error.
PolicyException
- passed on.protected boolean writeAttributeCertificate(File output, org.openpermis.cert.AttributeCertificate ac)
output
- the output file to write to.ac
- the certificate to write.
true
if the output file was written, false
in case of an error.protected boolean createSignedPolicy(File input, char[] pw, File output)
input
- the pkcs12 input file.pw
- the password for the pkcs12 input file.output
- the output file.
true
if the signed policy was created, false
otherwise.@Action public void cancel()
@Action public void execute()
|
![]() |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
PERMIS Role Based Access Control 0.4.0 (Build 15)
2009/05/20 08:15:22
Copyright (c) 2002-2007 Ergon Informatik AG