# Package net.sourceforge.jnlp.security

package generally about showing various security prompts

See: Description

- Interface Summary
  Interface | Description
  --- | ---
  AppVerifier | An interface that provides various details about an app's signers.
  CertVerifier | An interface that provides various details about certificates of an app.

- Class Summary
  Class | Description
  --- | ---
  CertificateUtils | Common utilities to manipulate certificates.
  ConnectionFactory |
  HttpsCertVerifier |
  JNLPAppVerifier |
  JNLPAuthenticator |
  KeyStores | The `KeyStores` class allows easily accessing the various KeyStores used.
  KeyStores.KeyStoreWithPath |
  PluginAppVerifier |
  SecurityDialog | Provides methods for showing security warning dialogs for a wide range of JNLP security issues.
  SecurityDialogMessage | Represents a message to the security framework to show a specific security dialog
  SecurityDialogMessageHandler | Handles `SecurityDialogMessage`s and shows appropriate security dialogs.
  SecurityDialogs | A factory for showing many possible types of security warning to the user.
  SecurityUtil |
  VariableX509TrustManager | This class implements an X509 Trust Manager.
  VariableX509TrustManagerJDK7 |

- Enum Summary
  Enum | Description
  --- | ---
  KeyStores.Level |
  KeyStores.Type |
  SecurityDialogs.AccessType | The types of access which may need user permission.
  SecurityDialogs.DialogType | Types of dialogs we can create

## Package net.sourceforge.jnlp.security Description

package generally about showing various security prompts

### Following diagram shows how dialog is handled when some application/appelt needs to show it

            ITW-thread(s)               | dialogs-thread                                                                                                                                  X
                                        |                                                                                                                                                 X
       presteps in SecurtyDialogs       |                                                                                                                                                 X
          # eg handle trustall/none     |                                                                                                                                                 X
                |                       |                                                                                                                                                 X
        prepare message                 |                                                                                                                                                 X
                   # set JNLPfile       |                                                                                                                                                 X
                   # set type of dialog |                                                                                                                                                 X
                       see              |                                                                                                                                                 X
                   # extrass...         |                                                                                                                                                 X
                   # lock               |                                                                                                                                                 X
                |                       |                                                                                                                                                 X
        post message to queue           |                                                                                                                                                 X
                | >------------------------------------> | <----------------------------------------------------------------------------------------------------------------------------| X
        wait for result from            |            read message from queue                                                                                                            | X
              getUserResponse(lock lock)|                |                                                                                                                              | X
                                        |            create instance of dialogue                                                                                                        | X
                                        |                |                                                                                                                              | X
                                        |            according to type of dialogue, create and place panel  (this is important, panel is keeper of rememberable decision)               | X
                                        |                |                                                                                                                              | X
                                        |            if panel is instance of RememberableDialog                                                                                         | X
                                        |              else                        then                                                                                                 | X
                                        |                |                          |                                                                                                   | X
                                        |                |                         check whether this applet+action was already stored and permanently remembered in .appletSecurity    | X
                                        |                |                          no                                                                        yes                       | X
                                        |                |<-------------------------|                                                                          |                        | X
                                        |                |                                                                                                     |                        | X
                                        |                |                                                                                                     |                        | X
                                        |                |                                                                                                     |                        | X
                                        |                |                                                                                                     |                        | X
                                        |            add closing and disposing listener(s) to button(s)                                                        |                        | X
                                        |                |     * set return value to listener?                                                                 |                        | X
                                        |                |                                                                                                     |                        | X
                                        |                      according to set value, set default selected button?                                            |                        | X
                                        |                |                                                                                                     |                        | X
                                        |            if his applet+action was already stored in .appletSecurity include text approved/denyed and when          |                        | X
                                        |                |                                                                                                     |                        | X
                                        |            wait for user to click button or close dialogue                                                          |                        | X
                                        |                |                                                                                                     |                        | X
                                        |                --> set selected value (via listener?) to message, dispose dialog -> <- set stored value to message <-|                        | X
                                        |                                                                                    |                                                          | X
                                        |                    if panel is instance of RememberableDialogue crate new, update old(date/decision,jars...) record in .appletSecurity        | X
                                        |                                                                                    |                                                          | X
                | <------------------------------------------------------------------------------------------< unlock lock of this message  >--------------------------------------------| X
      read result from message          |                                                                                                                                                 X
                |                       |                                                                                                                                                 X
       continue accordingly             |                                                                                                                                                 X
                                                                                                                                                                                          X

### How to make your dialog to be remembered

- make your extension of SecurityPanel implementing RememberableDialog:

> - RememberPanelResult getRemeberAction - if your dialogue uses RememberPanel, then you get RememberPanelResult for free
> - DialogResult getValue() - what your dialogue actually returns. If it is some simple Yes, No.. Then you can use existing types in dialogresults package. If it handles something more complex, you can inspire yourself in AccessWarningPaneComplexReturn
> - JNLPFile getFile() - ok, file keeps all needed to identify applet/app, so it is a must.
> - DialogResult readValue(String s) - the dialog must be able to read answer from String, which is supplied to it via engine. If you use some PrimitivesSubset extension, then it is mostly only static call its factory creator from String.

This should be all. The value your type writeValue to file, is then stored under Key, which is your extension of SecurityPanel implementing RememberableDialog name

Submit a bug or feature